Closed lachieh closed 7 months ago
pr is welcome!
although im not sure why nobody has hit this issue before
Thanks, I'll get to that over the next couple of days.
although im not sure why nobody has hit this issue before
My guess is that you've covered the 80% use case by accepting various props, and I'm operating in the 20% use case because I need control over the Lottie instance. Multiply that with typescript usage and it's likely a pretty small number of people who have hit this.
Currently the type of the
ref
prop on thePlayer
component is inherited from theHTMLDivElement
, but in the source the Lottie instance is passed to the forwarded ref.Type inheriting here:
https://github.com/mifi/react-lottie-player/blob/66e98a12a6cae5f3dd7eb9c3c9aa2f0482e34e76/src/index.d.ts#L10-L26
Lottie ref assigned here:
https://github.com/mifi/react-lottie-player/blob/66e98a12a6cae5f3dd7eb9c3c9aa2f0482e34e76/src/makeLottiePlayer.js#L66-L70
I am happy to assist with correcting this by exposing the
animElementRef
prop and correcting the types for both if a PR would be accepted.