mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
fix(theme-common): prepare usage of useSyncExternalStore compatibility with React 18 (#8618)
This commit is contained in:
parent
1bff83cacc
commit
140f0b1d4c
1 changed files with 5 additions and 1 deletions
|
@ -56,7 +56,11 @@ export function useHistorySelector<Value>(
|
|||
selector: (history: History<unknown>) => Value,
|
||||
): Value {
|
||||
const history = useHistory();
|
||||
return useSyncExternalStore(history.listen, () => selector(history));
|
||||
return useSyncExternalStore(
|
||||
history.listen,
|
||||
() => selector(history),
|
||||
() => selector(history),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue