You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React creates warnings for each call of React.useEffect regardless of whether an effect was actually scheduled i.e. the effect was run.
The expected behavior
If it is impossible for an effect to be run I shouldn't have to wrap it in act. Changing the behavior would help identifying what effects were unexpectedly scheduled. Right now we receive warnings for effects that are unrelated to a specific update.
I consider the current warning misleading and unnecessary because the documentation talks about "all updates related to these “units”" which is not the case here in my opinion. The act warning says "When testing, code that causes React state updates should be wrapped into act(...):" which also doesn't apply here: The code in question could not cause a state update from an effect.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
Uh oh!
There was an error while loading. Please reload this page.
React version: 16.13.1 and
next
Steps To Reproduce
Link to code example: https://codesandbox.io/s/missing-act-on-every-effect-ldy3b?file=/src/index.test.js
The current behavior
React creates warnings for each call of React.useEffect regardless of whether an effect was actually scheduled i.e. the effect was run.
The expected behavior
If it is impossible for an effect to be run I shouldn't have to wrap it in act. Changing the behavior would help identifying what effects were unexpectedly scheduled. Right now we receive warnings for effects that are unrelated to a specific update.
I consider the current warning misleading and unnecessary because the documentation talks about "all updates related to these “units”" which is not the case here in my opinion. The act warning says "When testing, code that causes React state updates should be wrapped into act(...):" which also doesn't apply here: The code in question could not cause a state update from an effect.
The text was updated successfully, but these errors were encountered: