- useActualRef<S>(initialState?): readonly [MutableRefObject<S>, ((dispatch: S | ((prevState: S) => S)) => void)]
Parameters
Optional
initialState: S | (() => S)
Returns readonly [MutableRefObject<S>, ((dispatch: S | ((prevState: S) => S)) => void)]
- An array containing the state reference and handleState function
Custom hook that creates a mutable reference to a state value and a function to update the state value.