We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40cb98d commit 5c6fc39Copy full SHA for 5c6fc39
packages/nuqs/src/useQueryStates.ts
@@ -88,6 +88,26 @@ export function useQueryStates<KeyMap extends UseQueryStatesKeysMap>(
88
initialSearchParams
89
)
90
91
+ React.useEffect(() => {
92
+ // This will be removed in v2 which will drop support for
93
+ // partially-functional shallow routing (14.0.2 and 14.0.3)
94
+ if (window.next?.version !== '14.0.3') {
95
+ return
96
+ }
97
+ const state = parseMap(
98
+ keyMap,
99
+ initialSearchParams,
100
+ queryRef.current,
101
+ stateRef.current
102
+ )
103
+ setInternalState(state)
104
+ }, [
105
+ Object.keys(keyMap)
106
+ .map(key => initialSearchParams?.get(key))
107
+ .join('&'),
108
+ keys
109
+ ])
110
+
111
// Sync all hooks together & with external URL changes
112
React.useInsertionEffect(() => {
113
function updateInternalState(state: V) {
0 commit comments