I have a menu component that appears globally. What is the best practice for getting data into that component?
I'm trying to take advantage of static generation that Next.js offers but all data fetching guidance from the Next.js team relates to pages. getStaticProps
and getStaticPaths
seem to pertain to page generation, not data for components. Is their SWR
package the right answer, or Apollo Client?
Typically in hooks-based React, I'd just put my data call into useEffect
. I'm not sure how to reason this out being that everything is rendered at build time with Next.