From 7343c29389d189421b6c27a4d3b5617f75a3062a Mon Sep 17 00:00:00 2001 From: Billy Moon Date: Fri, 2 Aug 2024 10:52:47 +0100 Subject: [PATCH] reproduce the problem --- examples/with-redux/app/verify/page.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/examples/with-redux/app/verify/page.tsx b/examples/with-redux/app/verify/page.tsx index 6c8a169aac8fc..a443210d1e28e 100644 --- a/examples/with-redux/app/verify/page.tsx +++ b/examples/with-redux/app/verify/page.tsx @@ -1,4 +1,18 @@ +"use client"; +import { increment } from "@/lib/features/counter/counterSlice"; +import { useAppStore } from "@/lib/hooks"; +import { useRef } from "react"; + export default function VerifyPage() { + // set store data as described in... + // https://redux.js.org/usage/nextjs#per-route-state + const store = useAppStore(); + const initialized = useRef(false); + if (!initialized.current) { + store.dispatch(increment()); + initialized.current = true; + } + return ( <>

Verify page