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

18 lines
354 B
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
import { render, hydrate, unmountComponentAtNode } from 'preact/compat'
export function createRoot(container) {
return {
render(children) {
render(children, container)
},
unmount() {
unmountComponentAtNode(container)
}
}
}
export function hydrateRoot(container, children) {
hydrate(children, container)
return createRoot(container)
}