Skip to content

Commit 8724020

Browse files
authored
fix: hydrateRoot is not a function for react19 (#71)
1 parent c10e209 commit 8724020

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pollfill/react-helper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function render(app: React.ReactElement, container: Element | DocumentFra
4141
reactRender(app, container)
4242
}
4343
else if (isReact19) {
44-
import('react-dom/client').then(({ createRoot }) => {
44+
import('react-dom/client').then(({ default: { createRoot } }) => {
4545
const root = createRoot(container)
4646
React.startTransition(() => {
4747
root.render(app)
@@ -69,7 +69,7 @@ export function hydrate(app: React.ReactElement, container: Element | DocumentFr
6969
reactHydrate(app, container)
7070
}
7171
else if (isReact19) {
72-
import('react-dom/client').then(({ hydrateRoot }) => {
72+
import('react-dom/client').then(({ default: { hydrateRoot } }) => {
7373
React.startTransition(() => {
7474
hydrateRoot(container as Element, app)
7575
})

0 commit comments

Comments
 (0)