Access getServerSideProps in the getServerSideProps? #17517
-
Hi guys, just a short question. I need to create global configuration object based on the domain /en/de/it and access it while fetching the data in the getServerSideProps method. My idea was to create it in the _app wrapper and provide as a props to the other components. The question is if it's possible to access the props in the getServerSideProps? Do you have any other idea how I could solve that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Create a utility that would generate your configuration object and -> Hope this helps |
Beta Was this translation helpful? Give feedback.
Create a utility that would generate your configuration object and ->
i) use it within _app wrapper if your components need it
ii) use it within getServerSideProps (from context.req object, you can find the domain) to create that object.
Hope this helps