Skip to content

Commit

Permalink
Merge pull request #4028 from Scott-Fischer/master
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian authored May 26, 2023
2 parents fb8cfa9 + dbb6b97 commit 9aca7f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declare namespace React {
export import Inputs = _hooks.Inputs;
export import PropRef = _hooks.PropRef;
export import Reducer = _hooks.Reducer;
export import Dispatch = _hooks.Dispatch;
export import Ref = _hooks.Ref;
export import StateUpdater = _hooks.StateUpdater;
export import useCallback = _hooks.useCallback;
Expand All @@ -40,6 +41,7 @@ declare namespace React {
): T;

// Preact Defaults
export import Context = preact.Context;
export import ContextType = preact.ContextType;
export import RefObject = preact.RefObject;
export import Component = preact.Component;
Expand Down
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 9aca7f4

Please sign in to comment.