450742274a
This corrects the case where `/index` is used during revalidation for an optional catch-all route and `index` is passed as a param even though it should be undefined. This also adds test cases to make sure the params are normalized correctly Fixes: https://github.com/vercel/next.js/issues/16366
24 lines
464 B
JavaScript
24 lines
464 B
JavaScript
export default function Home(props) {
|
|
return <pre id="props">{JSON.stringify(props)}</pre>
|
|
}
|
|
|
|
export async function getStaticPaths() {
|
|
return {
|
|
paths: [
|
|
{ params: { slug: false } },
|
|
{ params: { slug: ['a'] } },
|
|
{ params: { slug: ['hello', 'world'] } },
|
|
],
|
|
fallback: false,
|
|
}
|
|
}
|
|
|
|
export async function getStaticProps({ params }) {
|
|
return {
|
|
props: {
|
|
params,
|
|
random: Math.random(),
|
|
},
|
|
revalidate: 1,
|
|
}
|
|
}
|