Skip to content

Commit

Permalink
fix: Protection against null useSearchParams in Next.js (#781)
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 authored Nov 23, 2024
1 parent a504e0e commit 56e15a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuqs/src/useQueryState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export function useQueryState<T = string>(
)

useEffect(() => {
const query = initialSearchParams.get(key) ?? null
const query = initialSearchParams?.get(key) ?? null
if (query === queryRef.current) {
return
}
Expand Down

0 comments on commit 56e15a0

Please sign in to comment.