Debugger shows correct value server-side, yet I get the safe value and a console error. #11871
Unanswered
JorgeSivil
asked this question in
Help
Replies: 1 comment
-
So the problem is that the state is not shared with the client... But I don't know how to overcome this I set up useState in the App container, and it works OK server side, but then the state is not shared client side |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Debug start:
It goes to getServerSideProps() function. There I wait for some API call.
Then I get that information in my _app.js
Then it goes to the page again, to render (Note that currentLoggedInUserName is set with a value that is NOT Guest)
But when page finishes loading, I get this:
If I go to Page2 then back to Page1, I get the correct result.
What is going on?
Beta Was this translation helpful? Give feedback.
All reactions