The Type for Next Js's
import type { GetServerSideProps } from 'next'
interface Order {
firstName: string
lastName: string
orderNo: string
}
const OrderPage = (order: Order) => {
return (
<>
<p>{order.firstName}</p>
<p>{order.lastName}</p>
<p>{order.orderNo}</p>
</>
)
}
export const getServerSideProps: GetServerSideProps = async () => {
return {
props: {
order: {
firstName: 'Donald',
lastName: 'Duck',
orderNo: 'DL100'
}
}
}
}
export default Home
In case you wonder, my
<Component {...pageProps.order} />
My