streamich/react-use

useEnsuredForwardedRef not working with callback refs

Open

#805 opened on Nov 26, 2019

View on GitHub
 (2 comments) (1 reaction) (0 assignees)TypeScript (43,979 stars) (3,273 forks)batch import
bughelp wanted

Description

If the forwarded ref is a callback ref the callback isn't called properly.

useEnsuredForwardedRef should check if the passed ref is a callback-function and if that's the case call it to set the ref.

Contributor guide