diff --git a/src/components/DocsLayout.tsx b/src/components/DocsLayout.tsx index c37c3aee0..fb43a1931 100644 --- a/src/components/DocsLayout.tsx +++ b/src/components/DocsLayout.tsx @@ -186,13 +186,13 @@ const useMenuConfig = ({ children: [ { label: 'Home', - to: '/$libraryId/$version', + to: '..', }, ...(frameworks.length > 1 ? [ { label: 'Frameworks', - to: '/$libraryId/$version/docs/framework', + to: './framework', }, ] : []), @@ -325,10 +325,10 @@ export function DocsLayout({ repo, children, }: DocsLayoutProps) { - const params = useParams({ strict: false }) - const libraryId = params.libraryId || '' - - const { _splat } = params + const { libraryId } = useParams({ + from: '/$libraryId/$version/docs', + }) + const { _splat } = useParams({ strict: false }) const frameworkConfig = useFrameworkConfig({ frameworks }) const versionConfig = useVersionConfig({ versions }) const menuConfig = useMenuConfig({ config, frameworks, repo }) @@ -399,16 +399,8 @@ export function DocsLayout({ ) : ( { detailsRef.current.removeAttribute('open') }}