Closed
Description
Hey there 👋
I'm getting an act
warning when using react-query hooks because of this:
Basically what's happening is my component finishes rendering and then react-query triggers a re-render (thanks to this) which is the thing that's giving me the act warning.
Now I can add an await waitFor(() => {})
call to the end of my test and the warning goes away, but I think it would be better to have an assertion in that callback. I'm just not sure what to assert happened as a result of the state update.
Do you have any suggestions for people testing this stuff? Should I just set the staleTime
to Infinity
? Kinda thinking that might work except then my tests would have a different config from my app which could lead to some problems.
Any ideas?
Metadata
Metadata
Assignees
Labels
No labels