1- import type { ComponentType , ReactNode } from 'react'
1+ import type { ComponentType } from 'react'
22import { getRouteApi , Link , notFound , redirect } from '@tanstack/react-router'
33import { DocsLayout } from '~/components/DocsLayout'
44import { RedirectVersionBanner } from '~/components/RedirectVersionBanner'
55import { Scarf } from '~/components/Scarf'
66import { findLibrary , getBranch , getLibrary } from '~/libraries'
77import type { LibraryId } from '~/libraries'
88import { getTanstackDocsConfig } from '~/utils/config'
9- import { fetchLandingCodeExample } from '~/utils/landing-code-example.functions'
109import { seo } from '~/utils/seo'
1110
12- export type LandingComponentProps = {
13- landingCodeExampleRsc ?: ReactNode
14- }
11+ export type LandingComponentProps = Record < string , never >
1512
1613type LandingComponent = ComponentType < LandingComponentProps >
1714
@@ -113,7 +110,7 @@ export function createLibraryLandingPage<TId extends StaticLandingRoutePath>(
113110
114111 function LibraryLandingPage ( ) {
115112 const { version } = routeApi . useParams ( )
116- const { config, landingCodeExampleRsc } = routeApi . useLoaderData ( )
113+ const { config } = routeApi . useLoaderData ( )
117114
118115 if ( ! config ) {
119116 throw notFound ( )
@@ -134,7 +131,7 @@ export function createLibraryLandingPage<TId extends StaticLandingRoutePath>(
134131 repo = { library . repo }
135132 isLandingPage
136133 >
137- < LandingComponent landingCodeExampleRsc = { landingCodeExampleRsc } />
134+ < LandingComponent />
138135 </ DocsLayout >
139136 < RedirectVersionBanner
140137 version = { version ! }
@@ -158,18 +155,10 @@ export function createLibraryLandingPage<TId extends StaticLandingRoutePath>(
158155 } )
159156 } ,
160157 loader : async ( { params } : { params : { version : string } } ) => {
161- const [ config , landingCodeExample ] = await Promise . all ( [
162- loadLibraryConfig ( libraryId , params . version ) ,
163- fetchLandingCodeExample ( {
164- data : {
165- libraryId,
166- } ,
167- } ) ,
168- ] )
158+ const config = await loadLibraryConfig ( libraryId , params . version )
169159
170160 return {
171161 config,
172- landingCodeExampleRsc : landingCodeExample ?. contentRsc ?? null ,
173162 }
174163 } ,
175164 head : ( ) => ( {
0 commit comments