Skip to content
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

Fix typescript error useSearchParams returns ReadonlyURLSearchParams | null with pages #154

Closed
frano-m opened this issue Aug 12, 2024 · 0 comments · Fixed by #155
Closed
Assignees

Comments

@frano-m
Copy link
Contributor

frano-m commented Aug 12, 2024

See https://nextjs.org/docs/app/api-reference/functions/use-search-params:

Good to know:
If an application includes the /pages directory, useSearchParams will return ReadonlyURLSearchParams | null. The null value is for compatibility during migration since search params cannot be known during pre-rendering of a page that doesn't use getServerSideProps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant