Skip to content

Commit

Permalink
Use object destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-hiyak committed Nov 26, 2024
1 parent a63a2bc commit f83ef17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/atomWithQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const atomWithQueryParams = <T>(
return atom<T, [SetStateAction<T>], void>(
// Read function: retrieves the current value of the query parameter.
(get) => {
const searchParams = get(locationAtom).searchParams;
const { searchParams } = get(locationAtom);
const paramValue = searchParams?.get(key);

// Use the resolver function to handle type casting and defaults.
Expand Down

0 comments on commit f83ef17

Please sign in to comment.