Why is this lib needed in Nextjs (app router)? #155
Unanswered
PeturSteinn
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just curious for why this library is needed at all with the app router in Nextjs.
I just don't know why I would need the script tag at all? Like why is it not good enough to populate a context provider via root layout, where I can just stick my prefered environment variables in the value and then consume that provider wherever I want?
Here's a minimal setup that I have in my head:
Then
<RuntimeEnvProvider />
is just a regular old context providerThen consuming it on the client would be easy like this....
I've got to be missing something, and I'm sorry if I am but I just have no idea why the script thing is needed at all.
Beta Was this translation helpful? Give feedback.
All reactions