diff --git a/packages/docusaurus-theme-common/src/utils/historyUtils.ts b/packages/docusaurus-theme-common/src/utils/historyUtils.ts index a81663feacbf..06b124a229ac 100644 --- a/packages/docusaurus-theme-common/src/utils/historyUtils.ts +++ b/packages/docusaurus-theme-common/src/utils/historyUtils.ts @@ -56,7 +56,11 @@ export function useHistorySelector( selector: (history: History) => Value, ): Value { const history = useHistory(); - return useSyncExternalStore(history.listen, () => selector(history)); + return useSyncExternalStore( + history.listen, + () => selector(history), + () => selector(history), + ); } /**