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
Hooks work fine even without it, but you'll likely need to add asynchrony to your code. With act() you'll be able to achieve the same results in synchronous manner.
To test behaviour that only occurs when props are updated it is
necessary to call update on the test instance. However, if the
behaviour under test is triggered by a hook, e.g. useEffect then
the test will fail because the hook is only triggered after the test
has run.
This addresses the issue by wrapping the update function with act().
callstack#111
Hooks work fine even without it, but you'll likely need to add asynchrony to your code. With
act()
you'll be able to achieve the same results in synchronous manner.See: https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
The text was updated successfully, but these errors were encountered: