-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Clarify useSearchParams
behavior
#60257
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delbaoliveira
requested review from
leerob and
molebox
and removed request for
a team
January 5, 2024 11:18
ijjk
added
area: documentation
created-by: Next.js Docs team
PRs by the Docs team.
labels
Jan 5, 2024
All broken links are now fixed, thank you! |
delbaoliveira
changed the title
Docs: Clarify useSearchParams behavior
Docs: Clarify Jan 5, 2024
useSearchParams
behavior
leerob
approved these changes
Jan 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
gaspar09
reviewed
Jan 5, 2024
@@ -525,7 +525,7 @@ See the [`revalidatePath` API reference](/docs/app/api-reference/functions/reval | |||
|
|||
### Dynamic Functions | |||
|
|||
`cookies`, `headers`, `useSearchParams`, and `searchParams` are all dynamic functions that depend on runtime incoming request information. Using them will opt a route out of the Full Route Cache, in other words, the route will be dynamically rendered. | |||
Dynamic functions like `cookies` and `headers`, and the `searchParams` prop in Layouts and Pages depend on runtime incoming request information. Using them will opt a route out of the Full Route Cache, in other words, the route will be dynamically rendered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: searchParams
is not passed to Layouts
agustints
pushed a commit
to agustints/next.js
that referenced
this pull request
Jan 6, 2024
- `useSearchParams` opts the client component subtree out of static rendering (pre-rendering), not dynamic rendering. We recommend wrapping the component that uses `useSearchParams` in a Suspense boundary to allow client components above it to be statically rendered (part of the initial HTML). Closes: https://vercel.slack.com/archives/C03S9JCH2Q5/p1704398859737719
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
useSearchParams
opts the client component subtree out of static rendering (pre-rendering), not dynamic rendering. We recommend wrapping the component that usesuseSearchParams
in a Suspense boundary to allow client components above it to be statically rendered (part of the initial HTML).Closes: https://vercel.slack.com/archives/C03S9JCH2Q5/p1704398859737719