Skip to content

Warning of ReactDOM.hydrate from react 18 alpha release #26663

@huozhi

Description

@huozhi

What version of Next.js are you using?

11.0.1

What version of Node.js are you using?

16.0.0

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

codesanbox

Describe the Bug

Testing next.js with swr@beta, saw this warning in the console

Warning: ReactDOM.hydrate is no longer supported in React 18. Use createRoot 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

Expected Behavior

React 18 hydrate correctly without seeing any warnings

To Reproduce

Create a new next.js app with next.js 11.0.1 and react & react-dom 18.0.0-alpha-e6be2d531

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions