Home > Mobile >  Cant perform react state cancel rtk query
Cant perform react state cancel rtk query

Time:04-06

I have a screen and if I press on submit and go back of the screen then I get:

cant perform react state

Of course, I load data which is not ready yet and after that I set a state. So I have to cancel it, when the user goes back. How I handle this ?

CodePudding user response:

This warning is known to be over-eager and will probably be removed in a future version of React. If it is not from your code, but from RTK Query, you can pretty safely just ignore it - it's just a race condition with the check that prints the warning, but there is no real memory leak - stuff will be cleaned up only a moment later.

  • Related