fix preact render to update a component on first render (#966)
* fix preact render to modify server-rendered code * add changeset
This commit is contained in:
parent
260d03b1b6
commit
f7e86150e0
2 changed files with 7 additions and 2 deletions
5
.changeset/cold-lies-move.md
Normal file
5
.changeset/cold-lies-move.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/renderer-preact': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix an issue where preact component UI wouldn't update on hydrate
|
|
@ -1,4 +1,4 @@
|
||||||
import { h, hydrate } from 'preact';
|
import { h, render } from 'preact';
|
||||||
import StaticHtml from './static-html.js';
|
import StaticHtml from './static-html.js';
|
||||||
|
|
||||||
export default (element) => (Component, props, children) => hydrate(h(Component, props, h(StaticHtml, { value: children })), element);
|
export default (element) => (Component, props, children) => render(h(Component, props, h(StaticHtml, { value: children })), element);
|
||||||
|
|
Loading…
Reference in a new issue