Updates extRefCallback
function:
- the second parameter may be a function
- its Typescript declaration for return type (not follow
React.RefCallback<T>
, we fix the return type as(instance: T | null) => void
becauseReact.RefCallback<T>
sometimes causes incompatibilty type)