Skip to content

Commit

Permalink
fix(useRef typedef): allow null initialValue (#2281)
Browse files Browse the repository at this point in the history
  • Loading branch information
armujahid authored and JoviDeCroock committed Jan 26, 2020
1 parent cfaa1ca commit a6cab5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type Ref<T> = { current: T };
* Note that `useRef()` is useful for more than the `ref` attribute. It’s handy for keeping any mutable
* value around similar to how you’d use instance fields in classes.
*/
export function useRef<T>(initialValue: T): Ref<T>;
export function useRef<T>(initialValue: T | null): Ref<T>;

/**
* `useRef` without an initial value is the special case handling `ref` props.
Expand Down

0 comments on commit a6cab5b

Please sign in to comment.