Using Suspense, but allowing stale value?
Unanswered
Chinese Alligator posted this in #help-forum
Chinese AlligatorOP
Is it possible to use suspense for async server-rendered components, but allow stale values for those components on navigation to another page that have the same components?
Something like
Here is the use case. We have a heavy API call that is used by two separate components, one for displaying the navigation, and one for showing the item data. The same call provides the navigation and the data. The call cannot be cached due to use of cookies.
We want to utilize the benefits of suspense, but yet show the stale navigation component when navigating to another page that has the two components. Otherwise both components show a skeleton loading on navigation, which is not very pretty.
Something like
useDeferredValue, but server-rendered components.Here is the use case. We have a heavy API call that is used by two separate components, one for displaying the navigation, and one for showing the item data. The same call provides the navigation and the data. The call cannot be cached due to use of cookies.
We want to utilize the benefits of suspense, but yet show the stale navigation component when navigating to another page that has the two components. Otherwise both components show a skeleton loading on navigation, which is not very pretty.