Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 48b89a0

Browse files
committed
use defaults
1 parent bfe04b2 commit 48b89a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/App.QueryParams.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
useQueryParams,
55
StringParam,
66
BooleanParam,
7+
withDefault,
78
} from 'use-query-params';
89

910
const App = () => {
@@ -53,8 +54,8 @@ const Bookshelf = () => {
5354
];
5455

5556
const [search, setSearch] = useQueryParams({
56-
title: StringParam,
57-
isCompleted: BooleanParam,
57+
title: withDefault(StringParam,''),
58+
isCompleted: withDefault(BooleanParam,false),
5859
});
5960

6061
const handleTitle = (event) => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /