Is there a way of getting search / query parameters on the server instead of client with app dir?
I would like to get the
?s
query parameter but according to the next docs it looks like the hook for it only works on the client side?
https://beta.nextjs.org/docs/api-reference/use-search-paramsClient Component Hooks: useSearchParams | Next.js
API reference for the useSearchParams hook.
1 Reply
It’s part of the props given to page components
https://beta.nextjs.org/docs/api-reference/file-conventions/page
File Conventions: Page | Next.js
API reference for the page.js special file.