Gamote / lottie-react

A lightweight React library for rendering complex After Effects animations in real time using Lottie.
https://lottiereact.com
Other
795 stars 58 forks source link

Support for React 18 #61

Closed ranaharoni closed 2 years ago

ranaharoni commented 2 years ago

Describe the bug

Does not appear to work with React 18.

To Reproduce

Steps to reproduce the behavior:

  1. Setup a project using React 18
  2. Run npm install lottie-react

Expected behavior

Should install without issues.

Additional context

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: website@0.1.0
npm ERR! Found: react@18.1.0
npm ERR! node_modules/react
npm ERR!   react@"18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0" from lottie-react@2.2.1
npm ERR! node_modules/lottie-react
npm ERR!   lottie-react@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/huckleberryfinn/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/huckleberryfinn/.npm/_logs/2022-05-22T09_45_33_234Z-debug-0.log
ahmedkhederali commented 2 years ago

i have the same error any solution?

fviazzi commented 2 years ago

For me, I had to use this command:

npm install lottie-react --legacy-peer-deps

This post explains the flag. Doesn't seem to have any impact on this module

ranaharoni commented 2 years ago

PR #58 should solve this. Waiting for it to get reviewed and merged.

Gamote commented 2 years ago

@ranaharoni @ahmedkhederali @fviazzi @tan-zx the issue was fixed in the v2.3.0 release.