Best approach for passing dynamic data to navbar and footer using getStaticProps #14008
Unanswered
stijnwesterhof
asked this question in
Help
Replies: 1 comment
-
TL;DR: In the page. You could create a helper function to make it easier, and even add React Context if the components are very nested. We don't support |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I used the getStaticProps for pre-rendering my product pages and it works really well, I like it! But I'm currently thinking of a way how I can use it (or if I should use it) for my navbar and footer.
The links that are going to be placed in the navbar and footer are dynamic and manageable via a Headless CMS. I know I can only use getStaticProps on pages/index files. So should I fetch the data for a navbar on every page's getStaticProps or is there a better way? Like a wrapper for example?
I hope someone can help me with this,
Beta Was this translation helpful? Give feedback.
All reactions