How to handle a static prop that you need on almost every page?
Answered
Little fire ant posted this in #help-forum
Little fire antOP
I am using the pages router. What is the best way for me to get and use a static prop that is frequently passed to components. Is there a better solution than having the same exact getstaticprops function in every page?
Answered by Little fire ant
I was able to solve this issue by using https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser
7 Replies
Little fire antOP
I was able to solve this issue by using https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser
Answer
Dunker
what
@Little fire ant I was able to solve this issue by using https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser
Somali
I’ve got to know what variable you set lol was it for the website name or something?
@Somali I’ve got to know what variable you set lol was it for the website name or something?
Little fire antOP
It was the base url for assets. For different environments
Somali
Makes sense ðŸ‘ðŸ»