The vanilla alternative for writing JSX-based React applications
git clone git://soophie.de/figure
39
}41
/**42
* Creates a dynamic component with its own state.43
* Should be used if the component is statefull (contains hooks).44
*45
* @param {ReactFunction} element - The string containing references46
* @param {Props} props - The component properties47
* @param {ReactElement[]} children - The child elements48
* @return {ReactElement} The created React component49
*/50
function dyn(element: ReactFunction, props?: Props, children?: ReactElement[]): ReactElement {51
return createElement(element, props, children);52
}54
/**55
* Joins the template literal slices together and replaces the values with references.56
* The values are being mapped to there corresponding references and with the populated57
* HTML string returned.
191
return [createElement(component ?? tag, props, ...children)];192
}181
return { dict };194
return { dict, dyn };195
}