useResetState
A hook to reset a state
Loading...
Installation
npx shadcn@latest add @shadcnhooks/use-reset-stateAPI
type ResetState = () => void
/**
* A hook to reset a state
* @param initialState - The initial state
*/
export function useResetState<S>(
initialState: S | (() => S),
): readonly [S, Dispatch<SetStateAction<S>>, ResetState]Credits
Last updated on