createFunctionalComponent

JSFunction createFunctionalComponent(

  1. ReactElement render(
    1. JSObject props
    )
)

Create a functional component - returns the component function itself.

Example:

final MyComponent = createFunctionalComponent((props) {
  return div(children: [pEl('Hello')]);
});

Implementation

JSFunction createFunctionalComponent(
  ReactElement Function(JSObject props) render,
) => ((JSAny props) => render(props as JSObject)).toJS;