db329fe9b0
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
42 lines
659 B
JavaScript
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
|