Skip to content

Commit

Permalink
fix: useInsertionEffect for useQueryStates
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Sep 14, 2023
1 parent 000aa62 commit 8b8b2e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/useQueryStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function useQueryStates<KeyMap extends UseQueryStatesKeysMap>(
})

// Sync all hooks together & with external URL changes
React.useEffect(() => {
React.useInsertionEffect(() => {
function syncFromURL(search: URLSearchParams) {
const state = parseMap(keyMap, search)
setInternalState(state)
Expand Down

0 comments on commit 8b8b2e9

Please sign in to comment.