rescript-lang / rescript-lang/rescript-lang.org

Document that you can do "intrinsic JSX elements"

Open
#818 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
MDX
Stars
1.9k
Forks
260
Avg merge
3d 9h
Merged PRs (30d)
17

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No documentation file or test is named in the issue. Locate the relevant JSX documentation, use the supplied Mesh example as the basis for the explanation, and consider the work done when intrinsic JSX elements and their custom props are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.