-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for React 17 #29
Comments
Hi @ben4d85, thank you for reporting this. I will add support for React |
Hi @Gamote, thank you for your reply! I am afraid I need a Lottie library I can use with React for a client project due next week. Appreciate that the fix might take you longer, so in the meantime, is there any other library you can recommend? |
@ben4d85 I don't know any stable React implementation at the moment. I guess you can try to make it work with the library provided by LottieFiles. |
If anyone else has the same problem, I ended up just using https://github.com/airbnb/lottie-web directly. |
If you want a non-React implementation it is a good idea to use the lottie-web directly. I will let you know when v3 is out. |
Hi @Gamote, we use your package in quite a few of our Apps and it's really handy! |
Hi @jackgraves Thank you for using this library. 💪 This issue is one of my top priorities, but sadly I am a bit busy until the end of March with my job. |
Thanks @Gamote for your response. That timeframe is completely reasonable - appreciate your time 🥇 |
The original react-lottie library seems to be abandoned and still uses deprecated React lifecycle methods [1]. These methods will be removed in React 17. Hence, migrate to lottie-react instead, which fixes the issue and is expected to have React 17 support [2]. [1]: chenqingspring/react-lottie#119 [2]: Gamote/lottie-react#29
@Gamote Hello thank you for this library. Your package has made life easier for a lot of people. Would it be possible to just upgrade to React 17 before a v3 upgrade? To be honest React 17 doesnt not introduce many breaking changes, I have looked through your source code and it should just be a quick and straight upgrade. Would be really cool if you would be open to this, but I would understand if not. Thank you. |
For anyone else looking for a solution for this, I ended up just doing npm i lottie-react --force. Its working perfectly for my simple use case because as mentioned React 16.8 => React 17.0 doesnt have many breaking changes. |
The original react-lottie library seems to be abandoned and still uses deprecated React lifecycle methods [1]. These methods will be removed in React 17. Hence, migrate to lottie-react instead, which fixes the issue and is expected to have React 17 support [2]. [1]: chenqingspring/react-lottie#119 [2]: Gamote/lottie-react#29
Same works for me in the meantime, thanks @iqbal125! |
You can try library from LottieFiles https://github.com/LottieFiles/lottie-react - work fine for me (React 17) |
@Gamote I will +1
I will +1 this... Probably would take about 30 minutes of work... Especially since there hasn't been any obvious activity around v3... |
Hey @heath-freenome I know a lot of people requested a fix for this and I am trying a lot to find some time to work on the From outside it might look just as 30 min. but there are other implications than just changing some code lines. I always encourage people to contribute if they really really need a fix/feature. For example, thanks to @musayann we will soon have support for React |
npm install --legacy-peer-deps will also work. Earlier versions of NPM treated invalid peer dependencies as a warning instead of an error. The -force switch forces everything to redownload again so I think using the legacy switch might be a better approach until we get the upgrade. |
Still get the same error. Why is that? |
Hey guys (@ben4d85 @jackgraves @iqbal125 @rustom @mosusky @heath-freenome @SpeedOfSpin @BierDav) This issue is solved in the new v2.2.0 version. Sorry for the long waiting time. |
Sorry guys but I don't understand how to use this? I still have the same problem How do I use V2.2.0 during the installation and bypass this problem? |
Maybe take a look at the usage docs of packagemanager (npm, yarn) |
install with yarn add react-lottie |
Hey @milts10, please share a screenshot with your error and the the exact command that you're using to install it. Also, do you already have an older version of
@Durgarao-Workathon that command will install a different library, if you still want to use this library, you will have to use:
|
Describe the bug
Does not appear to work with React 17 for me.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Not get an error.
Additional context
Error message in console when trying to install via npm:
The text was updated successfully, but these errors were encountered: