mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 13:38:33 +02:00
chore: backport retro compatible commits for the Docusaurus v2.3.1 release (#8621)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: Sébastien Castiel <sebastien@castiel.me>
This commit is contained in:
parent
c84d779627
commit
c60387dbe8
52 changed files with 296 additions and 212 deletions
|
@ -222,7 +222,10 @@ export function useScrollPositionBlocker(): {
|
|||
);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
nextLayoutEffectCallbackRef.current?.();
|
||||
// Queuing permits to restore scroll position after all useLayoutEffect
|
||||
// have run, and yet preserve the sync nature of the scroll restoration
|
||||
// See https://github.com/facebook/docusaurus/issues/8625
|
||||
queueMicrotask(() => nextLayoutEffectCallbackRef.current?.());
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue