having this issue that crash my app right away, i don't know what is wrong with it?,
while i was doing useQuery nromally i didn't had that prob, but now i need the getServerSideProps as i need to passs informations down 3 components .... and got this undefined. in jsx it will work, but typescript is not happ with it
export default function Home({ data }):JSX.Element {
return (
<div>
<div className="flex flex-col bg-gray-800 w-full items-center pb-10 ">
<div className="flex flex-col max-w-screen-xl w-full ">
<div className="flex flex-col text-white w-full p-10 ">
<div className="flex justify-between gap-10 ">
<h1 className=" uppercase font-medium">
<b>muhammad ali </b>
vs
<b> joe frazier</b>
</h1>
<p>New York, 1971 | 48:38</p>
</div>
<div className="w-full ">
<HomeVideo />
</div>
</div>
</div>
</div>
);
}
export async function getServerSideProps() {
const { loading, error, data } = await client.query({
query: GET_ALL_VIDEOS,
});
return {
props: {
loading: loading,
error: error || null,
data: data,
},
};
}