Skip to content

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Mar 12, 2022

I noticed while working on a different PR that this test was not using hydrateRoot correctly. You're meant to pass the initial children as the second argument.

I noticed while working on a different PR that this test was not
using hydrateRoot correctly. You're meant to pass the initial children
as the second argument.
@acdlite acdlite requested a review from eps1lon March 12, 2022 17:18
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 12, 2022
@acdlite acdlite merged commit 061ac27 into facebook:main Mar 13, 2022
const container = document.createElement('div');
container.innerHTML = '<div></div>';
ReactDOMClient.hydrateRoot(container).render(<Example />);
ReactDOMClient.hydrateRoot(container, <Example />);
Copy link
Collaborator

Choose a reason for hiding this comment

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

My initial reaction was that I'm glad I'm not the only one who gets this wrong. But it was me 😅

Copy link
Contributor

@bvaughn bvaughn Mar 14, 2022

Choose a reason for hiding this comment

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

Oh, this is too good!

@bvaughn
Copy link
Contributor

bvaughn commented Mar 14, 2022

Thanks for the fix.

zhengjitf pushed a commit to zhengjitf/react that referenced this pull request Apr 15, 2022
I noticed while working on a different PR that this test was not
using hydrateRoot correctly. You're meant to pass the initial children
as the second argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants