Nozbe / withObservables

HOC (Higher-Order Component) for connecting RxJS Observables to React Components
https://github.com/Nozbe/WatermelonDB
MIT License
68 stars 26 forks source link

react 18 #126

Closed heyalexchoi closed 1 year ago

heyalexchoi commented 2 years ago

I am a watermelon db user, using this package indirectly.

I am using the latest version of react native which uses react 18. withObservables has react 16/17 listed as a peer dependency.

if you are starting a new(ish) react native project, and install watermelon db, by default npm will install react 17 under watermelon db's node_modules. and once you start using watermelon db, or maybe it only with withObservables, you will start to see problems with 'multiple react versions' and hooks: https://github.com/Nozbe/WatermelonDB/issues/1246

I am seeing this issue. Tried deleting the second installation of react under watermelon db's node_modules and the problem went away, so I am pretty sure this is the cause.

can withObservables' peer dependency on react be expanded to include 18?

nicolasgeronimorodi commented 1 year ago

Have you found any solutions for this problem? Facing the same issue.

radex commented 1 year ago

Fixed in @nozbe/with-observables@1.5.0-2 / @nozbe/watermelondb@0.26.0-9