Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hydration with createRoot warning #14808

Merged
merged 1 commit into from
Feb 9, 2019

Conversation

sebmarkbage
Copy link
Collaborator

It's suggesting an API that doesn't exist.

{hydrate: true} is passed to createRoot, not render.

It's suggesting an API that doesn't exist. Fixed it to reference the actual
API.
@@ -410,7 +410,7 @@ describe('ReactDOMRoot', () => {
// We care about this warning:
'You are calling ReactDOM.hydrate() on a container that was previously ' +
'passed to ReactDOM.unstable_createRoot(). This is not supported. ' +
'Did you mean to call root.render(element, {hydrate: true})?',
'Did you mean to call createRoot(container, {hydrate: true}).render(element)?',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Did you mean to call createRoot(container, {hydrate: true}).render(element)?',
'Did you mean to call unstable_createRoot(container, {hydrate: true}).render(element)?',

Copy link
Contributor

Choose a reason for hiding this comment

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

or even ReactDOM.unstable_createRoot(?

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

Sorry, misunderstood the API. Thanks!

@sebmarkbage sebmarkbage merged commit 1d48b4a into facebook:master Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants