mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: update effect on callback change
This commit is contained in:
parent
e23ccd9124
commit
35f6084054
1 changed files with 1 additions and 1 deletions
|
|
@ -6,5 +6,5 @@ export function useOnLocationChange(
|
|||
extraDeps: React.DependencyList = [],
|
||||
) {
|
||||
const { href, pathname, search } = useLocation()
|
||||
React.useEffect(callback, [href, pathname, search, ...extraDeps])
|
||||
React.useEffect(callback, [href, pathname, search, callback, ...extraDeps])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue