Props interface for SSG page components.
This interface defines the shape of props that will be passed to your static page components during the build process. The params
object contains the route parameters extracted from the URL pattern.
interface
Props interface for SSG page components.
This interface defines the shape of props that will be passed to your static page components during the build process. The params
object contains the route parameters extracted from the URL pattern.
// Blog post component props
interface BlogPageProps extends SSGPageProps<{ slug: string }> {
// params: { slug: string } is automatically included
}
// Product page component props
interface ProductPageProps extends SSGPageProps<{
category: string;
id: string;
}> {
// params: { category: string; id: string } is automatically included
}
// Usage in component
function BlogPost({ params }: BlogPageProps) {
const { slug } = params; // TypeScript knows slug is a string
return <h1>Blog post: {slug}</h1>;
}