mifi / react-lottie-player

Fully declarative React Lottie player
MIT License
494 stars 52 forks source link

Warning: ForwardRef: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead. #100

Closed mmkal closed 1 year ago

mmkal commented 1 year ago

I get this console.error message in my component that wraps react-lottie-player:

Warning: ForwardRef: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.

version 1.5.4

edit: should mention, everything works fine and it's still useful! just looking to get rid of the error message

mifi commented 1 year ago

should be this line: https://github.com/mifi/react-lottie-player/blob/d730f8b2f053d432a39d414047aa19e419ffb919/src/makeLottiePlayer.js#L210

KDederichs commented 1 year ago

That looks like it yup. Basically just moving that into the Component method signature should fix it

selven commented 1 year ago

I've opened a PR for this, let me know if you want any changes

mifi commented 1 year ago

now fixed