mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-21 07:26:18 -05:00
Fixing issue where useQuery would continually set the query.
This commit is contained in:
parent
e4e0a1d722
commit
d9f7ca273c
1 changed files with 2 additions and 2 deletions
|
|
@ -136,12 +136,12 @@ export const useQuery = (defaultParams) => {
|
|||
if (!_.isEmpty(state)) {
|
||||
console.debug('Changing URL params', state);
|
||||
}
|
||||
}, [state]);
|
||||
}, [JSON.stringify(state)]);
|
||||
|
||||
React.useEffect(() => {
|
||||
// Keep URL and state in sync.
|
||||
setState(getSearchParamCopy(searchParams));
|
||||
}, [searchParams]);
|
||||
}, [JSON.stringify(searchParams)]);
|
||||
|
||||
const updateQuery = (newParams, replace = false) => {
|
||||
// Update the old state with the new values.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue