Skip to content

Commit

Permalink
backport #4028
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Jan 24, 2024
1 parent 9044691 commit 02c45eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hooks/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function useState<S = undefined>(): [
];

export type Reducer<S, A> = (prevState: S, action: A) => S;
export type Dispatch<A> = (action: A) => void;
/**
* An alternative to `useState`.
*
Expand All @@ -27,7 +28,7 @@ export type Reducer<S, A> = (prevState: S, action: A) => S;
export function useReducer<S, A>(
reducer: Reducer<S, A>,
initialState: S
): [S, (action: A) => void];
): [S, Dispatch<A>];

/**
* An alternative to `useState`.
Expand All @@ -43,7 +44,7 @@ export function useReducer<S, A, I>(
reducer: Reducer<S, A>,
initialArg: I,
init: (arg: I) => S
): [S, (action: A) => void];
): [S, Dispatch<A>];

/** @deprecated Use the `Ref` type instead. */
type PropRef<T> = MutableRef<T>;
Expand Down

0 comments on commit 02c45eb

Please sign in to comment.