Fetch data during static generate
I wonder if there is an option to fetch 3rd party api data during static generate. All options I tried also fetched the data in the browser.
2 Replies
Something like this here: https://nextjs.org/docs/pages/building-your-application/data-fetching/get-static-props
Data Fetching: getStaticProps | Next.js
Fetch data and generate static pages with
getStaticProps
. Learn more about this API for data fetching in Next.js.useAsyncData seems to do the trick, while useFetch moves the data fetch task to the browser. Maybe that should be stated more explicitly in the docs