Skip to content

Commit

Permalink
Fix hydration on site
Browse files Browse the repository at this point in the history
This fixes an incorrect patch applied in 427bcad, which should not
have changed.

Related-to: 427bcad.
Closes GH-2020.
  • Loading branch information
wooorm committed Apr 23, 2022
1 parent 0ff4ab3 commit 109f9c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/_asset/index.client.js
@@ -1,5 +1,5 @@
import React from 'react'
import {createRoot} from 'react-dom/client'
import {hydrateRoot} from 'react-dom/client'
import {createFromFetch} from 'react-server-dom-webpack'
import {Root} from './root.client.js'

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

1 comment on commit 109f9c1

@vercel
Copy link

@vercel vercel bot commented on 109f9c1 Apr 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mdx – ./

mdxjs.com
v2.mdxjs.com
mdx-mdx.vercel.app
mdx-git-main-mdx.vercel.app

Please sign in to comment.