Syntax Lookup

Enter some language construct you want to know more about.
This is the @jsx.component decorator.

Since 11.1

The @jsx.component decorator is used to annotate functions that are JSX components. This is a generic version that's equivalent to the existing @react.component for React.

You will need this decorator whenever you want to use JSX component in JSX expressions, with a generic JSX transform configured.

Example

ReScriptJS Output
// Assuming `Preact` is set up and configured as a generic JSX transform.
@jsx.component
let make = (~name) => {
  <button> {Preact.string("Hello " ++ name ++ "!")} </button>
}

References