fix(preact): ignore hydrate roots
This commit is contained in:
parent
16de67faff
commit
95e560ec41
1 changed files with 3 additions and 1 deletions
|
@ -1,8 +1,10 @@
|
|||
import { h, render } from 'preact';
|
||||
import StaticHtml from './static-html.js';
|
||||
|
||||
export default (element) => (Component, props, children) =>
|
||||
export default (element) => (Component, props, children) => {
|
||||
if (!element.hasAttribute('ssr')) return;
|
||||
render(
|
||||
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children),
|
||||
element
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue