export const getStaticProps = async () =>{
const res = await fetch("https://xxxxxxxxxxxxxxx")
const data = await res.json()
return {
props: {
data
}
}
}
const Home = ({data}) =>{
return <>
<h2> Static Props</h2>
{data && data.map(x=>{x})}</>
}
export default Home
I'm not sure why, but I have a very simple getStaticProps function that does a fetch to an external API and it doesn't seem to fire. No console.log is executing in the getStaticProps function. If someone has a working example that might help to compare, then that would be great.