Next.js Discord

Discord Forum

searchParams page props with PPR

Unanswered
Plague posted this in #help-forum
Open in Discord
PPR currently does nothing for a page that is opt-in to dynamic rendering via the searchParams prop on a page.tsx file.

Before it reaches stable, I wonder if it would be possible for the compiler with PPR enabled to see what exactly is consuming the searchParams and only opt those components into dynamic rendering. I know it's tough since technically the page.tsx file is already consuming searchParams just by accessing it via props.

Overall, I'm just hoping that either the compiler will somehow be able to tell where the searchParams are actually being used or alternatively (idk if this would be harder or easier) have any Server Component be able to read the searchParams prop.

Just some food for thought and something I thought I'd ask to see what others thoughts were on PPR involving searchParams as it seems like the most common way pages get opt-in to fully dynamic which defeats the purpose of PPR to me, but, perhaps it is unavoidable with searchParams

0 Replies