Skip to content

Commit

Permalink
ref: Use a useEffect rather than useLayoutEffect (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 authored Dec 29, 2024
1 parent 4762b04 commit 3fa04c6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/nuqs/src/adapters/lib/react-router.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import mitt from 'mitt'
import {
startTransition,
useCallback,
useEffect,
useLayoutEffect,
useState
} from 'react'
import { startTransition, useCallback, useEffect, useState } from 'react'
import { renderQueryString } from '../../url-encoding'
import type { AdapterInterface, AdapterOptions } from './defs'
import {
Expand Down Expand Up @@ -98,7 +92,7 @@ export function createReactRouterBasedAdapter(
window.removeEventListener('popstate', onPopState)
}
}, [])
useLayoutEffect(() => {
useEffect(() => {
emitter.emit('update', serverSearchParams)
}, [serverSearchParams])
return searchParams
Expand Down

0 comments on commit 3fa04c6

Please sign in to comment.