Skip to content

Commit

Permalink
fix(theme-common): do not run useLocationChange when hot reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Feb 16, 2022
1 parent 53c2c11 commit 469fce0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export function useLocationChange(onLocationChange: OnLocationChange): void {
const onLocationChangeDynamic = useDynamicCallback(onLocationChange);

useEffect(() => {
if (!previousLocation) {
return;
}

if (location !== previousLocation) {
onLocationChangeDynamic({
location,
Expand Down

0 comments on commit 469fce0

Please sign in to comment.