MCPcopy Create free account
hub / github.com/reactive-python/reactpy / bind

Function bind

src/py/reactpy/reactpy/web/templates/react.js:19–27  ·  view source on GitHub ↗
(node, config)

Source from the content-addressed store, hash-verified

17};
18
19export function bind(node, config) {
20 const root = ReactDOM.createRoot(node);
21 return {
22 create: (component, props, children) =>
23 React.createElement(component, wrapEventHandlers(props), ...children),
24 render: (element) => root.render(element),
25 unmount: () => root.unmount()
26 };
27}
28
29function wrapEventHandlers(props) {
30 const newProps = Object.assign({}, props);

Callers 1

useImportSourceFunction · 0.50

Calls 2

wrapEventHandlersFunction · 0.85
renderMethod · 0.45

Tested by

no test coverage detected