Skip to content

Commit

Permalink
Stringifiable URL search params for useSearchParams (#52)
Browse files Browse the repository at this point in the history
`URLSearchParams` is not stringifiable via `JSON`, so we instead get all entries (which returns an `Iterator`) and create an object out of it.
  • Loading branch information
bennettdams committed Nov 9, 2022
1 parent 019acb4 commit 3035b1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/HooksClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const HooksClient = () => {
{
usePathname: pathname,
selectedLayoutSegments: selectedLayoutSegments,
useSearchParams: searchParams,
useSearchParams: Object.fromEntries(searchParams.entries()),
"useSearchParam('key')": searchParam,
useRouter: {
push: '(string) => void',
Expand Down

1 comment on commit 3035b1a

@vercel
Copy link

@vercel vercel bot commented on 3035b1a Nov 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

layouts-playground – ./

app-dir.vercel.app
app-dir-playground.vercel.app
layouts-playground.vercel.sh
layouts-playground-git-main.vercel.sh

Please sign in to comment.