Replies: 2 comments
-
Did you get this sorted? I have been trying to make this work the same way |
Beta Was this translation helpful? Give feedback.
0 replies
-
Experiencing the same, some guidance please! |
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.
-
Summary
Hey all, here is my situation:
I have a server component page that fetches data with await, a client component that the page renders when the data is fetched, and a loading.tsx file. Something like:
The page uses search params when fetching the data.
Current behaviour:
/search?filter1=foo
and loading.tsx is shown while data is being fetched.router.push('/search?filter1=foo&filter2=bar')
This only happens when re-navigating to /search from within /search. If the user goes to some other page and clicks a link to pointing to
/search?filter3=baz
the loading animation is shown again, as desired.Desired behaviour:
/search?filter1=foo
and loading.tsx is shown while data is being fetched.router.push('/search?filter1=foo&filter2=bar')
Maybe another way to ask this question is: how can I purge/invalidate the router cache programmatically AND show loading.tsx again/destroy the current client component
I tried to work around the issue using loading overlays that are shown when a filter button is clicked and go away when loading is finished, using state. However this is tedious because its hard to detect when loading finishes.
I am open to other ideas as well, maybe I am thinking about this wrong. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions