diff --git a/src/content/learn/typescript.md b/src/content/learn/typescript.md index 7822f3623..5d0c19fcd 100644 --- a/src/content/learn/typescript.md +++ b/src/content/learn/typescript.md @@ -236,7 +236,9 @@ import { stateReducer, State } from './your-reducer-implementation'; const initialState = { count: 0 }; export default function App() { - const [state, dispatch] = useReducer(stateReducer, initialState); + const [state, dispatch] = useReducer< + (state: State, action: CounterAction) => State + >(stateReducer, initialState); } ```