redux-toolkit
redux-toolkit copied to clipboard
RTK-Query render data in one component and fire re-fetch from another one
Hi, The use case I'm trying to solve is: I have a component A where I use the query hook, and a component B (toaster) with a button that when clicked, I want to trigger the re-fetch of the data rendered in component A. How can I do that?
You can use cache tags. Add a specific cache tag to the query used by component A. Then dispatch a manual cache tag invalidation for that tag in component B.