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

[core] Bump React 19 in packages #44671

Closed
wants to merge 2 commits into from

Conversation

DiegoAndai
Copy link
Member

This PR picks all the bumps from #42824 except those related to docs infra. This way, we won't have to revert the package's dependencies if issues in the docs infra are found.

@DiegoAndai DiegoAndai added core Infrastructure work going on behind the scenes React 19 support About improving React 19 support labels Dec 6, 2024
@DiegoAndai DiegoAndai self-assigned this Dec 6, 2024
const { container } = render(<Data />);

expect(container.firstChild.textContent).to.equal('light:2'); // 2 because of double render within strict mode
expect(container.firstChild.textContent).to.equal('light');
expect(effectRunCount).to.equal(reactMajor >= 19 ? 2 : 3);
Copy link
Member Author

@DiegoAndai DiegoAndai Dec 6, 2024

Choose a reason for hiding this comment

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

This test was recently added, that's why we didn't cover it before in #42824.

The previous approach didn't work with React 19, probably due to the changes to strict mode. The difference in events between 18 and 19 is the following:

 render
 render
 run effect
-run effect (this one doesn't run in React 19)
 render
 render
 run effect

And for both, the last effect run wasn't being registered in the rendered content. That's why with React 18 the result was light:2 even though the effect runs 3 times. For React 19, the effect is runs 2 times.

@DiegoAndai DiegoAndai marked this pull request as draft December 6, 2024 15:31
@DiegoAndai DiegoAndai closed this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes React 19 support About improving React 19 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants