Skip to content

Commit

Permalink
fix(useQueryParams): fixes useQueryParam and useQueryParams state bug
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioru committed Jun 21, 2022
1 parent b23daa5 commit 8e71a1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/useQueryParam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const useQueryParam = <TParam extends string>(param: string, options: UseQueryPa

if (options.replaceState) {
history.replace({ search: params.toString() })
setValue(nextValue)
return
}

Expand Down
1 change: 1 addition & 0 deletions src/useQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const useQueryParams = <TParam extends string[]>(param: string, options: UseQuer

if (options.replaceState) {
history.replace({ search: params.toString() })
setValues(nextValues || [])
return
}

Expand Down

0 comments on commit 8e71a1b

Please sign in to comment.