#What is the proper way to load global data in Next.js?

4 messages · Page 1 of 1 (latest)

sullen junco
#

I have layout that includes a category section like this that coming from database,(The data may change after taking the build) What is the proper Next.js way to add this? If I use getInitialProps in _app.js it will disable Automatic Static Optimization, right?

sullen junco
#

Anyone?

wispy sinew
#

Not sure about Automatic Static optimisation, but you can call the api for data while loading the navbar itself

#

Since, navbar is shared component (assuming) loading data while navbar is rendering seems valid to me