How best to use this router and react-query? #638
Replies: 1 comment
-
After doing some more reading I guess I was overcomplicating it using |
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.
-
Let's say I have the following Item route that renders some details and a list of Children
and then I have the following in the
ItemProfile
When I go to
/items/123
and check the query dev tools the query is marked as inactive. I guess this is because I'm not using the query hook itself. If I go and delete one of children, the/items/123
query is not refetched. I'm invalidating it with the followingI'm pretty sure it isn't refetching on
/items/123
because the query isn't considered active, but even setting stale time to 0 didn't resolve it. The following was working before switching touseLoader
Using the non-null assertion is safe since the router guarantees it but it's kind of smelly. Is there a way to keep
useLoader
while correcting my refetching behaviour?Beta Was this translation helpful? Give feedback.
All reactions