Skip to content

Commit

Permalink
fix: typo (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
chesha1 authored Jun 7, 2024
1 parent de3214d commit 300613c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/learn/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const [requestState, setRequestState] = useState<RequestState>({ status: 'idle'

### `useReducer` {/*typing-usereducer*/}

[`useReducer`](/reference/react/useReducer) 是一个更复杂的 Hook,它接受一个 reducer 函数和一个初始 state 作为参数,并将从初始 state 推断出 reducer 函数的类型。你可以选择性地为 `useReducer` 提供类型参数以为 state 提供类型。但是更高的做法仍然是在初始 state 上添加类型:
[`useReducer`](/reference/react/useReducer) 是一个更复杂的 Hook,它接受一个 reducer 函数和一个初始 state 作为参数,并将从初始 state 推断出 reducer 函数的类型。你可以选择性地为 `useReducer` 提供类型参数以为 state 提供类型。但是更好的做法仍然是在初始 state 上添加类型:

<Sandpack>

Expand Down

0 comments on commit 300613c

Please sign in to comment.