-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bug: global.IS_REACT_ACT_ENVIRONMENT = false does not disable missing act warnings #1108
Comments
We enable missing act warnings in the global setup that comes with Hope this helps. If there's anything unclear, please let me know. |
@eps1lon any comment on the following? Why does it set |
Because we're not acting when we wait for something to flush. Anything wrapped in More detailed explainer: #937 (comment) |
I am having this issue also.
and neither of these solutions had any effect on the warning displaying. Any other ideas? |
An idea: For You can make sure your
|
Thank you. I have changed the test so that I don't need to do this currently, but if I end up having to revert I will try this 😄 |
@anilanar thank you, just tested this solution and it worked! |
The idea above does not work for me. Also, setting |
@Lokua Because you are not supposed to use |
This issue was first created in facebook/react, see facebook/react#24854.
The rational behind why we want to disable act warnings: facebook/react#23197
Potentially related to using jest. Didn't confirm.
React version: 18.2.0
Steps To Reproduce
create-react-app
with an adjustment toApp
component to trigger an asyncsetState
and an adjustment to the test to wait for that async state update.npm install
npm test -- --watchAll
The current behavior
It logs
Warning: An update to App inside a test was not wrapped in act(...).
The expected behavior
It does not log that warning.
The text was updated successfully, but these errors were encountered: