Function: useState()
Call Signature
useState<
S>(initialState:S| (() =>S)): [S,Dispatch<SetStateAction<S>>]
返回一个有状态的值,以及更新它的函数。
Type Parameters
Parameters
Returns
[S, Dispatch<SetStateAction<S>>]
Version
16.8.0
See
https://react.dev/reference/react/useState
Call Signature
useState<
S=undefined>(): [S|undefined,Dispatch<SetStateAction<S|undefined>>]
返回一个有状态的值,以及更新它的函数。
Type Parameters
Returns
[S | undefined, Dispatch<SetStateAction<S | undefined>>]
Version
16.8.0