Skip to content

Commit 109f9c1

Browse files
authored
Fix hydration on site
This fixes an incorrect patch applied in 427bcad, which should not have changed. Related-to: 427bcad. Closes GH-2020.
1 parent 0ff4ab3 commit 109f9c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/_asset/index.client.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import {createRoot} from 'react-dom/client'
2+
import {hydrateRoot} from 'react-dom/client'
33
import {createFromFetch} from 'react-server-dom-webpack'
44
import {Root} from './root.client.js'
55

@@ -14,6 +14,5 @@ if ('paintWorklet' in CSS) {
1414
async function main() {
1515
const nljson = document.querySelector('#payload').dataset.src
1616
const $root = document.querySelector('#root')
17-
const root = createRoot($root)
18-
root.render(<Root response={createFromFetch(fetch(nljson))} />)
17+
hydrateRoot($root, <Root response={createFromFetch(fetch(nljson))} />)
1918
}

0 commit comments

Comments
 (0)