Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sidebar issue on nextra-theme-docs #529

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions packages/website/src/components/collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function Collapse({
const containerRef = useRef<HTMLDivElement>(null!)
const initialOpen = useRef(isOpen)
const animationRef = useRef(0)
const initialRender = useRef(true)
useEffect(() => {
const animation = animationRef.current
const container = containerRef.current
Expand All @@ -27,9 +26,6 @@ export function Collapse({
animationRef.current = 0
}

if (initialRender.current) {
return
}
const child = container.children[0] as HTMLDivElement

if (horizontal) {
Expand All @@ -55,10 +51,6 @@ export function Collapse({
}
}, [horizontal, isOpen, openDuration])

useEffect(() => {
initialRender.current = false
}, [])

return (
<div
ref={containerRef}
Expand Down
Loading