After learning the Context API, you need to be careful on setting it up on NextJS, as it's an SSR (server-side rendering) framework. On each page refresh, context state is gone.
So you'd need to set up the context in what's called a special file, pages/_app.js, which you can read about here -> reacttricks.com/sharing-global-dat...
You're welcome there, Hemant :)
After learning the Context API, you need to be careful on setting it up on NextJS, as it's an SSR (server-side rendering) framework. On each page refresh, context state is gone.
So you'd need to set up the context in what's called a special file,
pages/_app.js
, which you can read about here -> reacttricks.com/sharing-global-dat...Yesπ€, will take care of it