Skip to content

Commit e4154a1

Browse files
authored
fix: Preserve hash in React Router based adpaters (#809)
1 parent 1635863 commit e4154a1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Diff for: packages/nuqs/src/adapters/react-router/v6.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ function useNuqsReactRouterV6Adapter() {
99
const updateUrl = (search: URLSearchParams, options: AdapterOptions) => {
1010
navigate(
1111
{
12-
search: renderQueryString(search)
12+
search: renderQueryString(search),
13+
hash: location.hash
1314
},
1415
{
1516
replace: options.history === 'replace',

Diff for: packages/nuqs/src/adapters/react-router/v7.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ function useNuqsReactRouterV7Adapter() {
99
const updateUrl = (search: URLSearchParams, options: AdapterOptions) => {
1010
navigate(
1111
{
12-
search: renderQueryString(search)
12+
search: renderQueryString(search),
13+
hash: location.hash
1314
},
1415
{
1516
replace: options.history === 'replace',

Diff for: packages/nuqs/src/adapters/remix.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ function useNuqsRemixAdapter() {
99
const updateUrl = (search: URLSearchParams, options: AdapterOptions) => {
1010
navigate(
1111
{
12-
search: renderQueryString(search)
12+
search: renderQueryString(search),
13+
hash: location.hash
1314
},
1415
{
1516
replace: options.history === 'replace',

0 commit comments

Comments
 (0)