Skip to content

Commit 993ea3c

Browse files
authored
Move to reanimated 3 (#2593)
* Move to reanimated 3 * Improve wording
1 parent 2837fdf commit 993ea3c

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

android/app/src/main/java/com/rnuilib/MainApplication.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import com.reactnativenavigation.NavigationApplication;
1111
import com.reactnativenavigation.react.NavigationReactNativeHost;
1212
import com.wix.reactnativeuilib.UiLibPackageList;
13-
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
1413

1514
import java.util.List;
1615

@@ -23,11 +22,6 @@ protected String getJSMainModuleName() {
2322
return "demo";
2423
}
2524

26-
@Override
27-
protected JSIModulePackage getJSIModulePackage() {
28-
return new ReanimatedJSIModulePackage();
29-
}
30-
3125
@Override
3226
public boolean getUseDeveloperSupport() {
3327
return BuildConfig.DEBUG;

demo/src/screens/incubatorScreens/IncubatorToastScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const TOAST_MESSAGES = {
1919
offline: 'Check Your Internet Connection'
2020
};
2121

22+
// TODO: "ReactImageView: Image source "null" doesn't exist" (Android + preset "none")
2223
class ToastsScreen extends Component {
2324
showToast = false; // keep this state in class instance for immediate response
2425
state = {

demo/src/screens/incubatorScreens/TouchableOpacityScreen.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import React, {Component} from 'react';
22
import {TouchableOpacity} from 'react-native';
33
import {View, Text, Colors, Incubator} from 'react-native-ui-lib';
44

5+
// TODO: Android - multiple clicks on the example that allows long press button (maybe dragging is also involved) -->
6+
// long press on it --> sometimes the counter just start ticking up
7+
// (happens on 2.17.0 as well but more rare, with gestureHandlerRootHOC)
58
class TouchableOpacityScreen extends Component {
69
state = {
710
counter: 0,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"react-native-haptic-feedback": "^1.11.0",
112112
"react-native-linear-gradient": "2.6.2",
113113
"react-native-navigation": "7.32.1",
114-
"react-native-reanimated": "2.17.0",
114+
"react-native-reanimated": "3.1.0",
115115
"react-native-shimmer-placeholder": "^2.0.6",
116116
"react-native-svg": "^13.7.0",
117117
"react-native-svg-transformer": "^0.14.3",

src/components/sortableList/SortableListItem.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const animationConfig = {
2929
duration: 350
3030
};
3131

32+
// Reanimated 3 - Solving the following error:
33+
// ReanimatedError: Trying to access property `$backgroundDefault` of an object which cannot be sent to the UI runtime., js engine: reanimated
34+
const LIST_ITEM_BACKGROUND = Colors.$backgroundDefault;
35+
3236
const SortableListItem = (props: Props) => {
3337
const {children, index} = props;
3438

@@ -159,7 +163,7 @@ const SortableListItem = (props: Props) => {
159163
: defaultItemShadow.value;
160164

161165
return {
162-
backgroundColor: Colors.$backgroundDefault, // required for elevation to work in Android
166+
backgroundColor: LIST_ITEM_BACKGROUND, // required for elevation to work in Android
163167
zIndex,
164168
transform: [{translateY: translateY.value}, {scale}],
165169
opacity,

0 commit comments

Comments
 (0)