Search code examples
reactjscachingrenderreact-query

i want to rerender my component which used cache data by reactquery in react


hello i'm using react(next) with react-query

and i'm faced about render problem.

i am using cache data by react-query and i am changing my component by data's id.

but my browser cache my data by react-query.

so i'm fine when i request my data first-time.

but when i comeback to my prev data my component is not rendered coz of cache data

how can i fix this?? i want to render my component though i use cache data

react-query

Solution

  • you need to do Query Invalidation. check here for context