Skip to content

Move to reanimated 3 #2593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions android/app/src/main/java/com/rnuilib/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.reactnativenavigation.NavigationApplication;
import com.reactnativenavigation.react.NavigationReactNativeHost;
import com.wix.reactnativeuilib.UiLibPackageList;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;

import java.util.List;

Expand All @@ -23,11 +22,6 @@ protected String getJSMainModuleName() {
return "demo";
}

@Override
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage();
}

@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
Expand Down
1 change: 1 addition & 0 deletions demo/src/screens/incubatorScreens/IncubatorToastScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const TOAST_MESSAGES = {
offline: 'Check Your Internet Connection'
};

// TODO: "ReactImageView: Image source "null" doesn't exist" (Android + preset "none")
class ToastsScreen extends Component {
showToast = false; // keep this state in class instance for immediate response
state = {
Expand Down
3 changes: 3 additions & 0 deletions demo/src/screens/incubatorScreens/TouchableOpacityScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React, {Component} from 'react';
import {TouchableOpacity} from 'react-native';
import {View, Text, Colors, Incubator} from 'react-native-ui-lib';

// TODO: Android - multiple clicks on the example that allows long press button (maybe dragging is also involved) -->
// long press on it --> sometimes the counter just start ticking up
// (happens on 2.17.0 as well but more rare, with gestureHandlerRootHOC)
class TouchableOpacityScreen extends Component {
state = {
counter: 0,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"react-native-haptic-feedback": "^1.11.0",
"react-native-linear-gradient": "2.6.2",
"react-native-navigation": "7.32.1",
"react-native-reanimated": "2.17.0",
"react-native-reanimated": "3.1.0",
"react-native-shimmer-placeholder": "^2.0.6",
"react-native-svg": "^13.7.0",
"react-native-svg-transformer": "^0.14.3",
Expand Down
6 changes: 5 additions & 1 deletion src/components/sortableList/SortableListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const animationConfig = {
duration: 350
};

// Reanimated 3 - Solving the following error:
// ReanimatedError: Trying to access property `$backgroundDefault` of an object which cannot be sent to the UI runtime., js engine: reanimated
const LIST_ITEM_BACKGROUND = Colors.$backgroundDefault;

const SortableListItem = (props: Props) => {
const {children, index} = props;

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

return {
backgroundColor: Colors.$backgroundDefault, // required for elevation to work in Android
backgroundColor: LIST_ITEM_BACKGROUND, // required for elevation to work in Android
zIndex,
transform: [{translateY: translateY.value}, {scale}],
opacity,
Expand Down