This page catalogs all the special exports One supports from route files.
_layout
routes are special and do not support these exports unless specified.This export is needed for "ssg" type pages that use dynamic path segments (for example, [id].tsx
). At build-time, One will expand the id segment into multiple pages, using the values you return from generateStaticParams
.
The entire function and export generateStaticParams
will be removed at build-time and everything it depends on will be tree-shaken out of your client-side bundle.
You'll need to return an array of objects, where the object keys match the name inside the brackets. As an example, we'll use nested dynamic segments:
app/blog/[month]/[year]/[slug]+ssg.tsx
If this function returned this:
Then you'd generate one page at /blog/10/2025/some-slug
.
Edit this page on GitHub.