functionalComponent
ReactElement
functionalComponent(
- JSObject props
Create a React element with an inline functional component.
Example:
final element = functionalComponent('Counter', (props) {
final count = useState(0);
return div(children: [pEl('Count: ${count.value}')]);
});
Implementation
ReactElement functionalComponent(
String name,
ReactElement Function(JSObject props) render,
) => createElement(createFunctionalComponent(render));