export const getServerSideProps: GetServerSideProps = async (context) => {
const { isLoading, error, data } = useQuery('repoData', () =>
fetch(
'https://api.github.com/repos/tannerlinsley/react-query'
).then((res) => res.json())
)
console.log({ data })
return {
props: {
data,
},
}
Although there are many questions related to react invalid hook call in stackoverflow but still none of them able to solve my problem.