Skip to content

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 internal Behind-the-scenes enhancement. Formerly called “core”. integration: react About improving React support. labels Dec 6, 2024
@DiegoAndai DiegoAndai self-assigned this Dec 6, 2024

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.

@mui-bot
Copy link

mui-bot commented Dec 6, 2024

@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

integration: react About improving React support. internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants