reactjs / reactjs/react.dev

[Bug]: Example code console shows ReactDOM.hydrate warning

Open
#7,243 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug: unconfirmed
Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Summary

This is not technically a bug, just that the code console is not doing what it's expected to be doing. I think the version of React used in website should be updated in the docs. All the examples show this warning in the code console now.

Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

CleanShot 2024-10-22 at 12 23 47@2x

https://react.dev/reference/react-dom/hydrate#suppressing-unavoidable-hydration-mismatch-errors

Page

https://react.dev/reference/react-dom/hydrate#suppressing-unavoidable-hydration-mismatch-errors

Details

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked React documentation page and inspect how its example code console selects and loads the React version. Reproduce the warning, then update the documentation example setup so the console no longer reports the ReactDOM.hydrate warning and verify the page still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.