React-native-draggable-flatlist: Support react-native-reanimated 2

Created on 21 Nov 2020  路  14Comments  路  Source: computerjazz/react-native-draggable-flatlist

Describe the solution you'd like
We could take advantages of the new react-native-reanimated 2, already using Turbo Modules.

Most helpful comment

@computerjazz Quite confused, since package.json requires reanimated v2.0 or higher as a peer dependency? So if the migration is not ready, why did the peer deps get bumped?

Not wanting to hijack this issue but when I use v2 I'm unable to drag on the iOS simulator on v2.6.2. Works perfectly fine with reanimated < 2.0.0

All 14 comments

The same problem

@computerjazz is there any plans to rewrite the lib with reanimated v2, now that it is stable?

@nelsonprsousa @computerjazz Hello, please take a look at this request. https://github.com/computerjazz/react-native-draggable-flatlist/pull/270

Can't wait. Thanks for this cool lib.

@pirroman Just checked that #270 was merged, however we still have warnings using REA v2 (it is working nevertheless)

@nelsonprsousa I saw those warnings. This is because Animated.createAnimatedComponent method is being used. It returns components with legacy references. I couldn't fix it quickly, but it shouldn't affect the work itself.

Okay, thank you @pirroman
It would be awesome to see a real migration to v2 to take advantage of turbo modules, maybe the author can do it someday 馃槣

;)

276

Wow, you rock 馃殌

UPDATE: While migrating to reanimated 2 is in the long-term plan, v2 currently has performance issues when rendering lots of nodes. Until these are addressed, this package (as well as react-native-swipeable-item) will stick to the v1 implementation, which is much more performant.

see:
https://github.com/software-mansion/react-native-reanimated/issues/1710
https://github.com/software-mansion/react-native-reanimated/issues/1635
https://github.com/software-mansion/react-native-reanimated/discussions/1632

UPDATE: While migrating to reanimated 2 is in the long-term plan, v2 currently has performance issues when rendering lots of nodes. Until these are addressed, this package (as well as react-native-swipeable-item) will stick to the v1 implementation, which is much more performant.

see:
software-mansion/react-native-reanimated#1710
software-mansion/react-native-reanimated#1635
software-mansion/react-native-reanimated#1632

Will there be a beta using v2 that we can use if we want?

v2 migration is on hold until the rewrite is released (https://github.com/computerjazz/react-native-draggable-flatlist/pull/281) and the above performance issues are addressed.

@computerjazz Quite confused, since package.json requires reanimated v2.0 or higher as a peer dependency? So if the migration is not ready, why did the peer deps get bumped?

Not wanting to hijack this issue but when I use v2 I'm unable to drag on the iOS simulator on v2.6.2. Works perfectly fine with reanimated < 2.0.0

v2 peer dep shouldn't have been bumped, I will revert that. This package is currently compatible with BOTH v1 and v2, and v1 will be supported for the immediate future.

The migration is completely separate from making the package _compatible_ with v2. The purpose of the migration is to make this package actually _use_ the new v2 apis. Since v2 is backwards compatible, we can still use the v1 apis.

Not sure about that drag issue. please open a separate issue with a snack repro.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dev-sathish picture dev-sathish  路  7Comments

soumyamishra89 picture soumyamishra89  路  10Comments

exentrich picture exentrich  路  6Comments

chriszwickerocteris picture chriszwickerocteris  路  9Comments

henriqueweiand picture henriqueweiand  路  5Comments