New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: next-urql
– send App props for pre-pass
#2573
Labels
future 🔮
An enhancement or feature proposal that will be addressed after the next release
Comments
tomvardasca
added
the
future 🔮
An enhancement or feature proposal that will be addressed after the next release
label
Jul 28, 2022
I believe we're running into a similar issue when trying to use withUrqlClient on _app.js alongside next-i18next's appWithTranslations |
3 tasks
Closing due to inactivity. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Using the
next-urql
library withwithUrqlClient
is used withssr: true
, all the Next App tree is re-rendered. When we usewithUrqlClient
in theApp
everything works fine. But when we usewithUrqlClient
in pages and have React Context providers in the customAapp
that receive props fromApp.getInitialProps
. In the pre-pass step, this values (it only fetches thePage.getInitialProps
) and no App props fromApp.getInitialProps
. This can be an issue if, for example, we use a Feature Flag React context, the behavior in the pre-pass step will be different.Proposed Solution
What I want to propose is a callback inside
WithUrqlClientOptions
where we could send this app props from the Next context, something like:And the only change would be in
with-urql-client.ts
:With this, we are able to send the app props, and keep using the context in the pre-pass step.
The text was updated successfully, but these errors were encountered: