The instruction passed to a Dispatch function in useState to tell React what the next value of the useState should be.
Often found wrapped in Dispatch.
The type of the state.
// This return type correctly represents the type of// `setCount` in the example below.const useCustomState = (): Dispatch<SetStateAction<number>> => { const [count, setCount] = useState(0); return setCount;} Copy
// This return type correctly represents the type of// `setCount` in the example below.const useCustomState = (): Dispatch<SetStateAction<number>> => { const [count, setCount] = useState(0); return setCount;}
The instruction passed to a Dispatch function in useState to tell React what the next value of the useState should be.
Often found wrapped in Dispatch.