Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-hiyak committed Nov 25, 2024
1 parent 54e53e8 commit 50d76bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/05_query_params/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import React from 'react';
const pageAtom = atomWithQueryParams('page', 1);

const Page = () => {
const [Page, setPage] = useAtom(pageAtom);
const [page, setPage] = useAtom(pageAtom);
return (
<div>
<div>Page {Page}</div>
<div>Page {page}</div>
<button type="button" onClick={() => setPage((c) => c + 1)}>
+1
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/atomWithQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const atomWithQueryParams = <T>(
const resolvedDefault = resolveDefaultValue(currentValue);

nextValue = String(
(value as (prev: T | undefined) => T)(resolvedDefault),
(value as (curr: T | undefined) => T)(resolvedDefault),
);
} else {
// Otherwise, use the provided value directly.
Expand Down

0 comments on commit 50d76bc

Please sign in to comment.