searchParams
Unanswered
oxmaster posted this in #help-forum
oxmasterOP
Such was the question. Which is better? Get "searchParams" from the page and throw it through 1-2 components to the desired one, or is it better to just use Search Params?
3 Replies
Pass the searchParams down. Unless you have to do prop drilling, In which case you are better off just using useSearchParam.
Also take a look at this:
https://nextjs.org/docs/app/api-reference/file-conventions/page#searchparams-optional
Also take a look at this:
https://nextjs.org/docs/app/api-reference/file-conventions/page#searchparams-optional
Using this in a page will mark that page as dynamic page and it wont be statically generated at build time
oxmasterOP
Thanks for the answer, but I already know that. I'm more interested in what is better for the page to be dynamic, if some parts of it are dynamic or somewhere dynamically parts are made client-side. What is more profitable in terms of performance and to be beautiful. I understand that there is a problem with prop drilling, but if it is small (1-2 components), is it acceptable?