Skip to content

Commit

Permalink
fix: Preserve hash in React Router based adpaters (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 authored Dec 13, 2024
1 parent 1635863 commit e4154a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/nuqs/src/adapters/react-router/v6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ function useNuqsReactRouterV6Adapter() {
const updateUrl = (search: URLSearchParams, options: AdapterOptions) => {
navigate(
{
search: renderQueryString(search)
search: renderQueryString(search),
hash: location.hash
},
{
replace: options.history === 'replace',
Expand Down
3 changes: 2 additions & 1 deletion packages/nuqs/src/adapters/react-router/v7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ function useNuqsReactRouterV7Adapter() {
const updateUrl = (search: URLSearchParams, options: AdapterOptions) => {
navigate(
{
search: renderQueryString(search)
search: renderQueryString(search),
hash: location.hash
},
{
replace: options.history === 'replace',
Expand Down
3 changes: 2 additions & 1 deletion packages/nuqs/src/adapters/remix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ function useNuqsRemixAdapter() {
const updateUrl = (search: URLSearchParams, options: AdapterOptions) => {
navigate(
{
search: renderQueryString(search)
search: renderQueryString(search),
hash: location.hash
},
{
replace: options.history === 'replace',
Expand Down

0 comments on commit e4154a1

Please sign in to comment.