-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Dedupe legacy context warnings #30299
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Similar to other warnings about legacy APIs, only raise a warning once per component. .
@@ -105,7 +104,7 @@ describe('ReactDOMServerIntegrationLegacyContextDisabled', () => { | |||
<RegularFn /> | |||
</span> | |||
</LegacyProvider>, | |||
render === clientRenderOnBadMarkup ? 4 : 3, | |||
3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The different number of warnings originates from this PR, but didn't have a reason there. I assume it was just updated to make the test pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On hydration mismatch we retry with client rendering in the new root so you got the warning again since it wasn't deduped.
That we now have the same count with good and bad markup shows that it's properly deduped 👍🏻
I'll add a comment to the original PR. There were a bunch of PR with the same pattern back then so I just forgot to mention it in each one.
@@ -105,7 +104,7 @@ describe('ReactDOMServerIntegrationLegacyContextDisabled', () => { | |||
<RegularFn /> | |||
</span> | |||
</LegacyProvider>, | |||
render === clientRenderOnBadMarkup ? 4 : 3, | |||
3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On hydration mismatch we retry with client rendering in the new root so you got the warning again since it wasn't deduped.
That we now have the same count with good and bad markup shows that it's properly deduped 👍🏻
I'll add a comment to the original PR. There were a bunch of PR with the same pattern back then so I just forgot to mention it in each one.
Similar to other warnings about legacy APIs, only raise a warning once per component.
.
Stack created with Sapling. Best reviewed with ReviewStack.