animxyz icon indicating copy to clipboard operation
animxyz copied to clipboard

Pls make it compatible with react 18

Open apuatcfbd opened this issue 3 years ago • 4 comments

apuatcfbd avatar Jul 07 '22 11:07 apuatcfbd

npm i error

Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2" from @animxyz/[email protected]
npm ERR! node_modules/@animxyz/react
npm ERR!   @animxyz/react@"^0.6.6" from the root project

apuatcfbd avatar Jul 07 '22 11:07 apuatcfbd

I tested with React 18 and it works, I just needed to change the peer dependencies to not throw a warning. Try the latest version and it should work!

milesingrams avatar Jul 22 '22 20:07 milesingrams

@milesingrams as you said, it works only when we install peer deps with npm i --legacy-peer-deps, will this increase bundle size?

apudiu avatar Jul 28 '22 05:07 apudiu

The update for @animxyz/react v0.6.7 makes the peer dependencies allow for anything above React 17:

"peerDependencies": {
    "react": ">= 17",
    "react-dom": ">= 17"
  },

I tested this with a React 18 project and I didn't see a warning. Are you using @animxyz/react v0.6.7?

milesingrams avatar Aug 08 '22 21:08 milesingrams