Persisting initial query params #16135
Unanswered
patjakubik
asked this question in
Help
Replies: 0 comments
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.
-
Hi all,
I have a situation where users land on my app with query parameters like:
/?user_id=123&hash=xyz
In my _app.js I capture those query params with
getInitialProps
and pass them to the page aspageProps
.It works well when user lands on the page. I can access both of those query params inside the page. However once they navigate using
next/router
ornext/link
I lose all of that data.The question is - how to store it?
I took a look on some React Context examples, however I'm not sure if that's the right solution for my problem, and the examples are a bit off from what I want to achieve.
How would you tackle this problem?
Thank you.
Love Next.js 🙏
Beta Was this translation helpful? Give feedback.
All reactions