katoikia-app/web-ui/web-react/node_modules/preact/compat/client.js

20 lines
396 B
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
const { render, hydrate, unmountComponentAtNode } = require('preact/compat');
function createRoot(container) {
return {
render(children) {
render(children, container);
},
unmount() {
unmountComponentAtNode(container);
}
};
}
exports.createRoot = createRoot;
exports.hydrateRoot = function(container, children) {
hydrate(children, container);
return createRoot(container);
};