0

The problem I am facing can be described as follows:

I am using Next.js, Redux Toolkit, and Next Redux Wrapper. I have created a Redux slice with a state variable called "counter." Additionally, I have two pages named "test-1" and "test-2."

On "test-1" page, I increased the value of the counter to 3. However, when I click on a link to navigate to the "test-2" page, the counter variable is immediately reset to its initial state.

Live demo for replicating the case.

I attempted to preserve the counter value between page transitions in Next.js using Redux Toolkit and Next Redux Wrapper. I expected the counter value to remain unchanged when navigating from "test-1" to "test-2" pages. However, the counter was reset to its initial state instead.

A.Casanova
  • 555
  • 4
  • 16
  • Always try to add some snipped of the code. So other users will understand better what are you trying to describe – A.Casanova Jul 20 '23 at 16:05

0 Answers0