devstar插件
This commit is contained in:
24
node_modules/preact/compat/client.mjs
generated
vendored
Normal file
24
node_modules/preact/compat/client.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { render, hydrate, unmountComponentAtNode } from 'preact/compat';
|
||||
|
||||
export function createRoot(container) {
|
||||
return {
|
||||
// eslint-disable-next-line
|
||||
render: function (children) {
|
||||
render(children, container);
|
||||
},
|
||||
// eslint-disable-next-line
|
||||
unmount: function () {
|
||||
unmountComponentAtNode(container);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function hydrateRoot(container, children) {
|
||||
hydrate(children, container);
|
||||
return createRoot(container);
|
||||
}
|
||||
|
||||
export default {
|
||||
createRoot,
|
||||
hydrateRoot
|
||||
};
|
Reference in New Issue
Block a user