我正在尝试使用 getServerSideProps nextJS 函数,但它不起作用。只需为我的道具返回 undefined ...
export async function GetServerSideProps(context){
var test = 3
return {
props: {
test
}
}
}
export default function Page(props){
console.log(props.test)
return (
<div>
{props.test}
</div>
)
}