I've been starting with a new Next application and going with functional components instead of class-based wherever possible. Following the documentation, I've set up the following with no luck:
import React from 'react';
import { GetServerSideProps, InferGetServerSidePropsType } from 'next';
export const getServerSideProps: GetServerSideProps = async () => {
return {
props: {
results: [1,2,3],
},
};
};
function Page({results}: InferGetServerSidePropsType<typeof getServerSideProps>) {
console.log(results) // undefined
return (
<div className="app__page header">page here</div>
)
}
export default Page;
Regardless of what I've tried I can't get any data back from getServerSideProps
, any help would be greatly appreciated!