Skip to content

Commit

Permalink
feat: Add SetStateAction & PropsWithoutRef types to compat (#4132)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Sep 15, 2023
1 parent 7748dcb commit f4093cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ declare namespace React {
export import Reducer = _hooks.Reducer;
export import Dispatch = _hooks.Dispatch;
export import Ref = _hooks.Ref;
export import StateUpdater = _hooks.StateUpdater;
export import SetStateAction = _hooks.StateUpdater;
export import useCallback = _hooks.useCallback;
export import useContext = _hooks.useContext;
export import useDebugValue = _hooks.useDebugValue;
Expand Down Expand Up @@ -155,7 +155,9 @@ declare namespace React {

export function forwardRef<R, P = {}>(
fn: ForwardFn<P, R>
): preact.FunctionalComponent<Omit<P, 'ref'> & { ref?: preact.Ref<R> }>;
): preact.FunctionalComponent<PropsWithoutRef<P> & { ref?: preact.Ref<R> }>;

export type PropsWithoutRef<P> = Omit<P, 'ref'>;

interface MutableRefObject<T> {
current: T;
Expand Down

0 comments on commit f4093cb

Please sign in to comment.