Search Param update (App router)
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
I understand that when A search param is changed (via Link), the entire page is re-rendered.
I also understand that in order to not wait for api calls to be done before rendering, we can use suspense and. It's show in the background
My problem,
I have a page that has some data showing in some components, but one component on that page is a tab which uses the url for It's state.
even though I have suspense wrapping most of my components, whenever I click the link, I can see the entire request (chrome dev tools) needs to be completed before the url change happens and before my tab changes state
When I use the search param as key for the suspense wrapping the other components, It works as expected but I don't want those components to go back to the loading state just because a tab not related to it changed
What I want to achieve,
I want to suspense without key changed to update in the background if it needs re-render, I don't what it to freeze the entire loading tree , I am aware that enabling prefetching will sort of remove this on production but I would like to not need to pre-fetch everything
I also understand that in order to not wait for api calls to be done before rendering, we can use suspense and. It's show in the background
My problem,
I have a page that has some data showing in some components, but one component on that page is a tab which uses the url for It's state.
even though I have suspense wrapping most of my components, whenever I click the link, I can see the entire request (chrome dev tools) needs to be completed before the url change happens and before my tab changes state
When I use the search param as key for the suspense wrapping the other components, It works as expected but I don't want those components to go back to the loading state just because a tab not related to it changed
What I want to achieve,
I want to suspense without key changed to update in the background if it needs re-render, I don't what it to freeze the entire loading tree , I am aware that enabling prefetching will sort of remove this on production but I would like to not need to pre-fetch everything
3 Replies
Siamese Crocodile
just like turn it off and on again then it'll work right