Prefer props to params
🌱 This post is in the growth phase. It may still be useful as it grows up.
When generating pages with
getStaticProps() you have access to
You can render these values into pages just fine but they can be
Because Astro allows undefined as a value to match the bare subdirectory path (
In TypeScript—Astro apps, this leaves you writing a lot of checks for
post_slug anywhere it’s used.
Better to pass values along as props and validate their types.