react-native-skeleton-content-nonexpo icon indicating copy to clipboard operation
react-native-skeleton-content-nonexpo copied to clipboard

Add support for Reanimated v3

Open phanghos opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. react-native-reanimated is evolving quickly and is currently at version 3.x.x at the time of this writing. According to their documentation, v2 is backwards-compatible with the v1 API but, starting from v3, some functions from the v1 API have been removed and are no longer supported. The current implementation of SkeletonContent relies on these deprecated functions, namely, useCode, set, cond, eq, and interpolateNode. This means that users won't be able to update their projects to use Reanimated v3 if they want to keep using this package.

Describe the solution you'd like In order to allow users to be able to keep using this package as the React Native ecosystem (and Reanimated) grow and evolve, it is necessary to support more recent versions of Reanimated.

Describe alternatives you've considered I have a migration plan that consists in the following steps:

  • Upgrade react-native-reanimated to the latest version 3.4.2 (currently 2.1.0)
  • Upgrade react-native-linear-gradient to the latest version 2.8.3 (currently 2.5.1)
  • Upgrade typescript to the latest version 5.2.2 (currently 3.7.2)
  • Add the Reanimated Babel plugin to support worklets
  • Remove dependency on react-native-redash
  • Refactor SkeletonComponent to use the new Reanimated APIs (worklets, useAnimatedStyle, withTiming, withRepeat)
  • Create atomic components for the different bones to keep the SkeletonContent file from growing too big
  • Update unit tests and snapshots

phanghos avatar Sep 19 '23 10:09 phanghos