Hey Caleb! Thanks for teaching this! Just a comment but I think it'd be helpful if the project would have a commit for each episode of the series. I wasn't that interested in the rest, and only interested in this episode, to catch up to what you have here, was a bit difficult. Cheers!
So using Next JS for the first time and I am about 80% finished with the project. I wanted the site to be 100% static but to fetch data from a Directus back end. Then I learned that you cannot getStaticProps in a non page component or the _app.js file. This means my nav(s) logo(s) and business information has to either be hard coded or I will need to pass them to each page individual (and make separate calls to the api for the data) or I will need to client side render the data (because I cannot simply include them in a layout). Needless to say this is a major disappointment. I was kinda hoping that someone out there knows of a different way.
⚛ FREE React Course (download & bonus content) - calcur.tech/free-react-course
React TH-cam Playlist - calcur.tech/react-playlist
Code - github.com/CalebCurry/react-query
github.com/CalebCurry/react-next
github.com/CalebCurry/react-graphql
github.com/CalebCurry/react-backend-django
github.com/CalebCurry/ts-axios
github.com/CalebCurry/react
Backend Python - www.codebreakthrough.com/backend-python
I needed this, right now. Thanks for your work brother.
Beautiful bro!
Great vid! Tnxxx
Where is app folder
Hey Caleb! Thanks for teaching this! Just a comment but I think it'd be helpful if the project would have a commit for each episode of the series. I wasn't that interested in the rest, and only interested in this episode, to catch up to what you have here, was a bit difficult. Cheers!
So using Next JS for the first time and I am about 80% finished with the project. I wanted the site to be 100% static but to fetch data from a Directus back end. Then I learned that you cannot getStaticProps in a non page component or the _app.js file. This means my nav(s) logo(s) and business information has to either be hard coded or I will need to pass them to each page individual (and make separate calls to the api for the data) or I will need to client side render the data (because I cannot simply include them in a layout). Needless to say this is a major disappointment. I was kinda hoping that someone out there knows of a different way.
Unfortunately that's just how next works for now. You can only do SSG at a page level.
Also while Gatsby is not the best either it does have per component queries for ssg but it can be a pain to work with tbh