Below is the component
function AsideLeft({initialAsideLeftHandler}: InferGetServerSidePropsType<typeof getServerSideProps>) {
console.log(initialAsideLeftHandler)
// ...
}
Below does not work and returns undefined
export const getServerSideProps:GetServerSideProps = async ({req}) => {
const cookies = parseCookies(req);
return {
props: {
initialAsideLeftHandler: cookies.asideLeftHandler
}
};
}
export default AsideLeft;
So I tried changing the return value to hardcoded object to see what would happen...but still, it returns undefined
export const getServerSideProps:GetServerSideProps = async () => {
return {
props: {
initialAsideLeftHandler: {x:0,y:0}
}
};
}
export default AsideLeft;