-
-
Save igorasilveira/2884d265d093f43918e4f6cc4df88138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Doggo({ data }) { | |
// Render data... | |
} | |
// This gets called on every request | |
export async function getServerSideProps() { | |
// Fetch data from external data source | |
const res = await fetch(`https://.../data`) | |
const data = await res.json() | |
// Pass data to the page via props | |
return { props: { data } } | |
} | |
export default Doggo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment