mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 18:32:52 +02:00
fix(theme-common): do not run useLocationChange when hot reloading (#6696)
This commit is contained in:
parent
53c2c118c4
commit
089ef14c9a
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,10 @@ export function useLocationChange(onLocationChange: OnLocationChange): void {
|
|||
const onLocationChangeDynamic = useDynamicCallback(onLocationChange);
|
||||
|
||||
useEffect(() => {
|
||||
if (!previousLocation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (location !== previousLocation) {
|
||||
onLocationChangeDynamic({
|
||||
location,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue