mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This ensures we don't apply the trailing slash redirect for `_next/data` requests as it can cause props to fail to resolve on client transition. This also fixes `missing` fields not being applied correctly for `headers` and `redirects` as the field wasn't being passed through. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) Closes: https://github.com/vercel/next.js/pull/45398 Fixes: https://github.com/vercel/next.js/issues/45393 x-ref: https://github.com/vercel/next.js/issues/45340
28 lines
576 B
TypeScript
28 lines
576 B
TypeScript
import { GetServerSideProps } from 'next'
|
|
import React from 'react'
|
|
|
|
export interface ProductPageProps {
|
|
test: string
|
|
}
|
|
|
|
const ProductPage = (params: ProductPageProps) => {
|
|
return (
|
|
<>
|
|
<h1 id="text">Param found: {params.test}</h1>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
|
|
const joined = Array.isArray(params['product-params'])
|
|
? params['product-params'].join(', ')
|
|
: params['product-params']
|
|
return {
|
|
props: {
|
|
test: joined ? joined : 'Not Found',
|
|
},
|
|
}
|
|
}
|
|
|
|
export default ProductPage
|