grammarly / focal

Program user interfaces the FRP way.
Apache License 2.0
723 stars 34 forks source link

Fix component mount prop type #35

Closed blacktaxi closed 6 years ago

blacktaxi commented 6 years ago

Currently the type of the mount prop incorrectly says that the parameter of the supplied function is a non-null value. At runtime, it is going to be the same argument as passed down to ref's callback from React, so its type is the same. The precise type is described in React typings as this:

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

Not sure about the bivarianceHack thing, I'll just refer to this exact type in Focal.