Skip to content

Commit 2745e6b

Browse files
birkskyumschiller-manuel
authored andcommitted
fix links
1 parent 608f30c commit 2745e6b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/components/DocsLayout.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,11 @@ export function DocsLayout({
325325
repo,
326326
children,
327327
}: DocsLayoutProps) {
328-
const { libraryId } = useParams({
329-
from: '/$libraryId/$version/docs',
330-
})
331-
const { _splat } = useParams({ strict: false })
328+
329+
const params = useParams({ strict: false })
330+
const libraryId = params.libraryId || ''
331+
332+
const { _splat } = params
332333
const frameworkConfig = useFrameworkConfig({ frameworks })
333334
const versionConfig = useVersionConfig({ versions })
334335
const menuConfig = useMenuConfig({ config, frameworks, repo })
@@ -399,8 +400,12 @@ export function DocsLayout({
399400
</a>
400401
) : (
401402
<Link
402-
to={child.to}
403-
params
403+
to="/$libraryId/$version/docs/$"
404+
params={{
405+
libraryId,
406+
version: params.version || 'latest',
407+
_splat: child.to
408+
}}
404409
onClick={() => {
405410
detailsRef.current.removeAttribute('open')
406411
}}

0 commit comments

Comments
 (0)