Partial Prerender Suspense Demo
The API call is set to revalidate after 30 seconds. I have also added an artificial delay of 3 seconds to better emphasis the initial load vs subsequent navigation.
What I have tried:
- Calling
router.refresh()
when navigating. Nothing happens that I can see. That is not included here, as it changed the project structure a bit (client components for Nav) - Adding a key to the
<Suspense />
ofJSON.stringify(searchParams)
, which fixes the issue in local development, but has no effect on the hosted version. This also makes the entire route dynamic, which defeats the purpose of it. However, I would take that as a tradeoff if it worked.
This page does not have a key on <Suspense />, making it a PPR page. Interestingly, if I wrap the word "Suspense" in a "pre" html tag, it causes a hydration issue. I am unsure if it's related, and doesn't matter to much.
The content below this line is wrapped in a suspense.
This content below this line is static, and below the suspense
Special thanks to https://punkapi.com/documentation/v2 for the data.