Skip to content

Commit

Permalink
Merge pull request #2803 from ivantm/master
Browse files Browse the repository at this point in the history
Make ref types' current property non-optional
  • Loading branch information
marvinhagemeister authored Oct 19, 2020
2 parents 9443406 + e0ca6d7 commit 005d43d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions hooks/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function useReducer<S, A, I>(
init: (arg: I) => S
): [S, (action: A) => void];

type PropRef<T> = { current?: T };
type PropRef<T> = { current: T };
type Ref<T> = { current: T };

/**
Expand Down Expand Up @@ -123,10 +123,7 @@ export function useContext<T>(context: PreactContext<T>): T;
* @param value Custom hook name or object that is passed to formatter
* @param formatter Formatter to modify value before sending it to the devtools
*/
export function useDebugValue<T>(
value: T,
formatter?: (value: T) => any
): void;
export function useDebugValue<T>(value: T, formatter?: (value: T) => any): void;

export function useErrorBoundary(
callback?: (error: any) => Promise<void> | void
Expand Down
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ declare namespace preact {

type Key = string | number | any;

type RefObject<T> = { current?: T | null };
type RefObject<T> = { current: T | null };
type RefCallback<T> = (instance: T | null) => void;
type Ref<T> = RefObject<T> | RefCallback<T>;

Expand Down

0 comments on commit 005d43d

Please sign in to comment.