Skip to content

Commit

Permalink
fix: Set the history state to null
Browse files Browse the repository at this point in the history
As recommended in the Next.js docs for shallow routing.

Historically, while Next.js didn't support shallow routing (<14.1.0),
maintaining the history state was the way to keep
the app router state.
  • Loading branch information
franky47 committed Jan 31, 2024
1 parent 25356b8 commit 9e54413
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuqs/src/update-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function flushUpdateQueue(router: Router): [URLSearchParams, null | unknown] {
options.history === 'push' ? history.pushState : history.replaceState
updateMethod.call(
history,
history.state,
null,
// Our own updates have a marker to prevent syncing
// when the URL changes (we've already sync'd them up
// via `emitter.emit(key, newValue)` above, without
Expand Down

0 comments on commit 9e54413

Please sign in to comment.