Skip to content

fix(website): eliminate sidebar and tab flicker on docs navigation#4345

Open
bohdanbirdie wants to merge 2 commits intorivet-dev:mainfrom
bohdanbirdie:fix/docs-sidebar-flicker
Open

fix(website): eliminate sidebar and tab flicker on docs navigation#4345
bohdanbirdie wants to merge 2 commits intorivet-dev:mainfrom
bohdanbirdie:fix/docs-sidebar-flicker

Conversation

@bohdanbirdie
Copy link

@bohdanbirdie bohdanbirdie commented Mar 3, 2026

Docs sidebar and tabs flicker on every page navigation. usePathname() hook initializes as empty string causing a no-active-state render, and framer-motion renders no inline styles during SSR so collapsible sections flash open then collapse during hydration.

Fix: pass Astro.url.pathname as a prop to React components instead of reading it client-side. Replace framer-motion with inline styles so SSR HTML matches hydrated state.

Before:

CleanShot.2026-03-04.at.00.27.45.mp4

After:

CleanShot.2026-03-04.at.00.31.49.mp4

Pass pathname from Astro server-side to React components instead of
reading it client-side via useEffect. Replace framer-motion in
CollapsibleSidebarItem with inline styles so SSR HTML matches hydrated
state.
@NathanFlurry NathanFlurry requested a review from jog1t March 3, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant