Why wont my Suspense trigger? #74142
Answered
by
icyJoseph
J4v4Scr1pt
asked this question in
Help
Replies: 1 comment 3 replies
-
Put a key in the Suspense boundary. You can search the issues/discussions, there is a good one explaining why loading doesn't re-trigger, and in general, Suspense boundaries, and the solution is to make them new instances, by giving them a new key. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I have a dashboard page with four parallel routes. In one pf them I want to change a list of items based on a searchParam.
I have a dropdown and use Nuqs to trigger non-shallow param change. This trigger my page to re-render.
No here is the tricky part, I want the loading.tsx to happen on initial load, then on searchParam changes trigger change to the list.
This is what I got so far.
The page:
The Await component:
I have tried a lot of things, adding a Fragment around the whole Card with the key prop to trigger re-render.
If I inspect with the React extension for Chrome I can see the key updating AFTER the fetch is done.
My initial thought was that any fetch would trigger the Loading.tsx file but that never happens, that's why I tested with this Await component to trigger suspense inside of the page.
Any ideas?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions