diff --git a/components/Layout/index.jsx b/components/Layout/index.jsx
index 3891b43..a887ff0 100644
--- a/components/Layout/index.jsx
+++ b/components/Layout/index.jsx
@@ -1,6 +1,5 @@
import TableOfContents from '@node-core/ui-components/Common/TableOfContents';
import Article from '@node-core/ui-components/Containers/Article';
-import RemoteLoadableBanner from '@node-core/doc-kit/src/generators/web/ui/components/AnnouncementBanner/RemoteLoadableBanner';
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/react';
@@ -8,6 +7,7 @@ import NavBar from '../Navigation';
import MetaBar from '../Metabar';
import SideBar from '../Sidebar';
import Footer from '../Footer';
+import { NavigationStateProvider } from '../../providers/navigationStateProvider';
/**
* @typedef {Object} Props
@@ -21,8 +21,7 @@ import Footer from '../Footer';
* @param {Props} props
*/
export default ({ metadata, headings, readingTime, children }) => (
- <>
-
+
@@ -42,5 +41,5 @@ export default ({ metadata, headings, readingTime, children }) => (
- >
-);
+
+);
\ No newline at end of file
diff --git a/components/Sidebar/index.jsx b/components/Sidebar/index.jsx
index 0d88837..32aff1e 100644
--- a/components/Sidebar/index.jsx
+++ b/components/Sidebar/index.jsx
@@ -1,5 +1,7 @@
import SideBar from '@node-core/ui-components/Containers/Sidebar';
import { sidebar } from '../../site.json' with { type: 'json' };
+import { useRef, useLayoutEffect } from 'react';
+import useScrollToElement from '../../hooks/useScrollToElement';
/** @param {string} url */
const redirect = url => (window.location.href = url);
@@ -9,12 +11,26 @@ const PrefetchLink = props => ;
/**
* Sidebar component for MDX documentation with page navigation
*/
-export default ({ metadata }) => (
-
-);
+export default ({ metadata }) => {
+ const sidebarRef = useRef(null);
+
+ // SideBar from @node-core/ui-components does not support forwardRef,
+ // so ref={sidebarRef} is silently ignored. useLayoutEffect runs before
+ // useEffect, so by the time useScroll's effect attaches the scroll
+ // listener, sidebarRef.current already points to the real