feat: test ISR

This commit is contained in:
Daniel Soares committed 2021-12-14 10:28:33 -03:00
1 parent aaaaedb73c
commit 2a1164d1fd
26 files changed
+295 -192

No files matched your search

+19 -3
View File
@@ -1,5 +1,21 @@
import { Dash } from '../components/Dash'
import { GetServerSideProps } from 'next'
export default function DashPage() {
return <Dash />
import { Dash } from '../components/Dash'
import { fetchData } from '../services/fetchData'
import type { Data } from '../types/Data'
type DashPageProps = {
initialData: Data
}
export default function DashPage({ initialData }: DashPageProps) {
return <Dash initialData={initialData} />
}
export const getServerSideProps: GetServerSideProps = async () => {
const initialData = await fetchData()
return {
props: { initialData }
}
}