Skip to content

Commit

Permalink
chore(docs): fix link to useSearchParams (#52348)
Browse files Browse the repository at this point in the history
### Overview
The purpose of this PR is to remove the wrong link to useParams in the useSearchParams documentation.

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
  • Loading branch information
gfgabrielfranca and styfle authored Jul 6, 2023
1 parent 4b2eef4 commit 2c12c6a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ To access search params in [Pages](/docs/app/api-reference/file-conventions/page

Unlike Pages, [Layouts](/docs/app/api-reference/file-conventions/layout) (Server Components) **do not** receive the `searchParams` prop. This is because a shared layout is [not re-rendered during navigation](/docs/app/building-your-application/routing#partial-rendering) which could lead to stale `searchParams` between navigations. View [detailed explanation](/docs/app/api-reference/file-conventions/layout#layouts-do-not-receive-searchparams).

Instead, use the Page [`searchParams`](/docs/app/api-reference/file-conventions/page) prop or the [`useSearchParams`](/docs/app/api-reference/functions/use-params) hook in a Client Component, which is re-rendered on the client with the latest `searchParams`.
Instead, use the Page [`searchParams`](/docs/app/api-reference/file-conventions/page) prop or the [`useSearchParams`](/docs/app/api-reference/functions/use-search-params) hook in a Client Component, which is re-rendered on the client with the latest `searchParams`.

## Examples

Expand Down

0 comments on commit 2c12c6a

Please sign in to comment.