segmentio / ui-box

Blazing Fast React UI Primitive
MIT License
1.07k stars 55 forks source link

use React.Ref instead of custom type #48

Closed mshwery closed 4 years ago

mshwery commented 4 years ago

Turns out React already has a type that covers our bases more fully than what I used.

type Ref<T> = { bivarianceHack(instance: T | null): void }["bivarianceHack"] | RefObject<T> | null;