File tree Expand file tree Collapse file tree
core/src/theme/components/DocContent/docComponents Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Link } from '@rspress/core/theme' ;
2- import type { ComponentProps } from 'react' ;
2+ import { startTransition , type ComponentProps } from 'react' ;
3+ import { useSite } from '@rspress/core/runtime' ;
34
45export const A = ( props : ComponentProps < 'a' > ) => {
5- return < Link { ...props } /> ;
6+ const siteData = useSite ( ) ;
7+ const concurrentRoute = siteData ?. site ?. route ?. concurrentRoute ;
8+ return (
9+ < Link
10+ startTransition = { concurrentRoute ? startTransition : undefined }
11+ { ...props }
12+ />
13+ ) ;
614} ;
Original file line number Diff line number Diff line change @@ -503,6 +503,13 @@ export interface RouteOptions {
503503 * @default false
504504 */
505505 cleanUrls ?: boolean ;
506+ /**
507+ * Enable concurrent, optimized routing for markdown links.
508+ * Only applies to links located inside `.md` and `.mdx` files.
509+ * @default false
510+ * @unstable
511+ */
512+ concurrentRoute ?: boolean ;
506513}
507514
508515export interface SearchHooks {
You can’t perform that action at this time.
0 commit comments