Skip to content

Commit

Permalink
reproduce the problem
Browse files Browse the repository at this point in the history
  • Loading branch information
billymoon committed Aug 2, 2024
1 parent 574e5bc commit 7343c29
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/with-redux/app/verify/page.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
<h1>Verify page</h1>
Expand Down

0 comments on commit 7343c29

Please sign in to comment.