don't fire missing act() warnings for react-art#15975
Merged
threepointone merged 3 commits intofacebook:masterfrom Jun 24, 2019
Merged
don't fire missing act() warnings for react-art#15975threepointone merged 3 commits intofacebook:masterfrom
threepointone merged 3 commits intofacebook:masterfrom
Conversation
forks toWarnDev from root into fixture/dom, updates tes tests to use it
- For 'secondary' renderers like react-act, we don't want to fire missing act() warnings; the wrapping renderer will fire warnings anyway, and when it flushes, it flushes effects *across* renderers. - I could have used isPrimaryRenderer as the flag, but this is marked as false for react-test-renderer, and we *do* want the warning to fire for it. Hence a new flag.
|
No significant bundle size changes to report. Generated by 🚫 dangerJS |
acdlite
approved these changes
Jun 24, 2019
rickhanlonii
pushed a commit
to rickhanlonii/react
that referenced
this pull request
Jun 25, 2019
* use toWarnDev for dom fixture tests forks toWarnDev from root into fixture/dom, updates tes tests to use it * disable act() warnings for react-art() - For 'secondary' renderers like react-act, we don't want to fire missing act() warnings; the wrapping renderer will fire warnings anyway, and when it flushes, it flushes effects *across* renderers. - I could have used isPrimaryRenderer as the flag, but this is marked as false for react-test-renderer, and we *do* want the warning to fire for it. Hence a new flag. * add missing dependency `art` to fixtures/dom
NMinhNguyen
referenced
this pull request
in enzymejs/react-shallow-renderer
Jan 29, 2020
* use toWarnDev for dom fixture tests forks toWarnDev from root into fixture/dom, updates tes tests to use it * disable act() warnings for react-art() - For 'secondary' renderers like react-act, we don't want to fire missing act() warnings; the wrapping renderer will fire warnings anyway, and when it flushes, it flushes effects *across* renderers. - I could have used isPrimaryRenderer as the flag, but this is marked as false for react-test-renderer, and we *do* want the warning to fire for it. Hence a new flag. * add missing dependency `art` to fixtures/dom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
react-art is a renderer that's usually embedded inside other renderer trees (like react-dom, etc) we fire a warning for being wrapped in the 'wrong' renderer's act. For an embedded usecase like react-art, this would mean you'd always see the warning. we could expose a new act() for react-art, but really we just want embedded renderers to not trigger the warning.
the first commit just fixes test infra for fixtures/dom (forking toWarnDev into itself)
the second commit is mostly what we're interested in 88fe0b4. For 'secondary' renderers like react-act, we don't want to fire missing act() warnings; the wrapping renderer will fire warnings anyway, and when it flushes, it flushes effects across renderers.
I could have used
isPrimaryRendereras the flag, but this is marked as false for react-test-renderer, and we do want the warning to fire for it. Hence a new flag.I'm open to a new name for
shouldWarnUnactedUpdates.