next.js
232d424b - [Cache Components] Do not automatically client render useSearchParams… (#83048)

Commit
252 days ago
[Cache Components] Do not automatically client render useSearchParams… (#83048) … when prerendering useSearchParams historically always bailed out to client side rendering when prerendering. The idea was that reading search params shouldn't deopt a page from static so instead it simply omitted prerendering any boundary with this hook inside of it. With Cache Components every page can be partially static so there is no huge perf cliff in adding this hook to any particular component. Additionally since client components cannot make a page be dynamic independently (something in the RSC layer must be) using this on an otherwise fully static page will still just result in the current client-only rendering behavior. But if you use useSearchParams on a page that has dynamic RSC it will now SSR when resuming.
Author
Parents
Loading