Navigating to a new URL blows away all my query data #8609
Replies: 1 comment
-
I figured it out. I needed to pass another variable into the query key. I thought it was blowing everything away, because the screen in the react query dev tools was going blank after I would navigate. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I cannot figure out why this is happening. I have a page that displays a table of pricelists. When you click on a pricelist, it opens up a sliding modal with that pricelist in it. That was all working fine and dandy until we decided we wanted to have a specific URL to open a specific pricelist. So now when we click on a pricelist, it changes the url from 'pricelists/active' to 'pricelists/active/12'. And then in my pricelists component I have this code:
And that part is working fine. However when I close the sliding modal I call
navigate('/pricelists/active');
and whenever that call is made, all my query data in the react-query dev tools goes away. I cannot figure out why that is happening.This query in the pricelists component should be showing query data:
Beta Was this translation helpful? Give feedback.
All reactions