fix(theme-common): do not run useLocationChange when hot reloading (#6696)

This commit is contained in:
Alexey Pyltsyn 2022-02-17 03:41:15 +03:00 committed by GitHub
parent 53c2c118c4
commit 089ef14c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,10 @@ export function useLocationChange(onLocationChange: OnLocationChange): void {
const onLocationChangeDynamic = useDynamicCallback(onLocationChange);
useEffect(() => {
if (!previousLocation) {
return;
}
if (location !== previousLocation) {
onLocationChangeDynamic({
location,