Skip to content

Document that you can do "intrinsic JSX elements" #818

Open
@zth

Description

@zth

Intrinsic JSX elements = lowercase JSX elements (<mesh /> from ThreeJs for example) that takes their own props, not just domProps which all lowercase JSX elements automatically do today.

This can be expressed already:

module Mesh = {
  type props = {
    position: (float, float, float),
    ref?: ReactDOM.domRef,
    scale?: float,
    onClick?: ReactEvent.Mouse.t => unit,
    onPointerOver?: ReactEvent.Mouse.t => unit,
    onPointerOut?: ReactEvent.Mouse.t => unit,
    children?: React.element,
  }

  @module("react/jsx-runtime") external make: (@as("mesh") _, props) => React.element = "jsx"
}

let rendered = <Mesh /> // will output <mesh> in the HTML

We need to document it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions