rsnext/test/integration/i18n-support-index-rewrite/pages/[...slug].js
JJ Kasper db329fe9b0
Ensure index rewrite is matched with i18n correctly (#20509)
This makes sure we don't generate the wrong locale source variant for the rewrite requiring a `/` on the end which won't ever be added causing the rewrite to never match. Additional tests have been added to ensure this specific rewrite is working correctly. 


Fixes: https://github.com/vercel/next.js/issues/20508
2020-12-28 18:21:28 +00:00

42 lines
659 B
JavaScript

import React from 'react'
const DynamicPage = (props) => (
<>
<div>DynamicPage</div>
<div id="props">{JSON.stringify(props)}</div>
</>
)
export const getStaticPaths = async ({ locales }) => {
const paths = []
for (const locale of locales) {
paths.push({
params: {
slug: ['hello'],
},
locale,
})
paths.push({
params: {
slug: ['company', 'about-us'],
},
locale,
})
}
return {
fallback: false,
paths,
}
}
export const getStaticProps = async ({ params, locale }) => ({
props: {
locale,
params,
hello: 'world',
},
})
export default DynamicPage