nandorojo / moti

🐼 The React Native (+ Web) animation library, powered by Reanimated 3.
https://moti.fyi
MIT License
3.9k stars 120 forks source link

Add `react-native` to peer dependencies #312

Closed heecheolman closed 8 months ago

heecheolman commented 9 months ago

moti imports react-native in its code.

https://github.com/nandorojo/moti/blob/master/packages/moti/src/components/view.tsx#L1

According to the rulebook of yarn, all packages should list all of what they require/import in its dependencies/peerDependencies.

We add react-native to moti's peerDependencies to resolve this problem.

(If not, the package might not work well when using Yarn 2+.)

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
moti ❌ Failed (Inspect) Oct 4, 2023 2:01am
nandorojo commented 8 months ago

Thanks for the note.

Is this actually necessary? No one has reported issues from it. I prefer to keep it in dev deps typically so as to not automatically import deps for someone, namely in monorepos.

I see no need for this, as anyone importing moti would have react-native imported already, and it should be linked natively to a single version only.

For dependencies other than react-native I think this makes sense. However, react-native (and react-native-web, for that matter) need to have only one version running in the app and Moti will always rely on the consumer to be the installer of those.

For packages like framer-motion, explicit mentions of them does make sense (which is why it's a direct dependency).