File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 3030 # 14.0.2 is not compatible due to a prefetch issue
3131 - latest
3232 include :
33+ # 14.0.3 requires the WHS flag
34+ - next-version : ' 14.0.3'
35+ window-history-support : true
36+ # Current latest is 14.0.4
3337 - next-version : latest
3438 window-history-support : true
3539 - next-version : latest
Original file line number Diff line number Diff line change @@ -30,5 +30,8 @@ function supportsWHS() {
3030 const pkgPath = new URL ( './package.json' , import . meta. url )
3131 const pkg = JSON . parse ( fs . readFileSync ( pkgPath , 'utf-8' ) )
3232 const nextVersion : string = pkg . dependencies . next
33- return semver . gte ( nextVersion , '14.0.3-canary.6' )
33+ return (
34+ semver . gte ( nextVersion , '14.0.3-canary.6' ) &&
35+ semver . lt ( nextVersion , '14.0.5-canary.54' )
36+ )
3437}
Original file line number Diff line number Diff line change @@ -240,15 +240,13 @@ export function useQueryState<T = string>(
240240 initialSearchParams ?. get ( key ) ?? null
241241 )
242242
243- if ( process . env . __NEXT_WINDOW_HISTORY_SUPPORT ) {
244- React . useEffect ( ( ) => {
245- const value = initialSearchParams . get ( key ) ?? null
246- const state = value === null ? null : safeParse ( parse , value , key )
247- debug ( '[nuqs `%s`] syncFromUseSearchParams %O' , key , state )
248- stateRef . current = state
249- setInternalState ( state )
250- } , [ initialSearchParams ?. get ( key ) , key ] )
251- }
243+ React . useEffect ( ( ) => {
244+ const value = initialSearchParams . get ( key ) ?? null
245+ const state = value === null ? null : safeParse ( parse , value , key )
246+ debug ( '[nuqs `%s`] syncFromUseSearchParams %O' , key , state )
247+ stateRef . current = state
248+ setInternalState ( state )
249+ } , [ initialSearchParams ?. get ( key ) , key ] )
252250
253251 // Sync all hooks together & with external URL changes
254252 React . useInsertionEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments