T
TanStack6d ago
foreign-sapphire

Prerendering dynamic pages

Hi, docs say that we can't prerender pages with dynamic params unless some other page links to it. Any way we can provide those dynamic params during build? Like fetch('/products') and pass id's to the prerender config? That's nextjs equivalent however I did not find it for tanstack start https://nextjs.org/docs/app/api-reference/functions/generate-static-params Automatic Static Route Discovery All static paths will be automatically discovered and seamlessly merged with the specified pages config Routes are excluded from automatic discovery in the following cases: Routes with path parameters (e.g., /users/$userId) since they require specific parameter values Layout routes (prefixed with _) since they don't render standalone pages Routes without components (e.g., API routes) Note: Dynamic routes can still be prerendered if they are linked from other pages when crawlLinks is enabled.
Functions: generateStaticParams | Next.js
API reference for the generateStaticParams function.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?