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.
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 toref
's callback from React, so its type is the same. The precise type is described in React typings as this:Not sure about the
bivarianceHack
thing, I'll just refer to this exact type in Focal.