Skip to content

Commit

Permalink
Mobile - Remove RNGestureHandlerEnabledRootView since its now deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo committed Oct 5, 2022
1 parent 995da19 commit 872b85c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 22 deletions.
25 changes: 14 additions & 11 deletions packages/edit-post/src/editor.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import memize from 'memize';
import { map, without } from 'lodash';
import { I18nManager } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';

/**
* WordPress dependencies
Expand Down Expand Up @@ -174,17 +175,19 @@ class Editor extends Component {
};

return (
<SlotFillProvider>
<EditorProvider
settings={ editorSettings }
post={ normalizedPost }
initialEdits={ initialEdits }
useSubRegistry={ false }
{ ...props }
>
<Layout setTitleRef={ this.setTitleRef } />
</EditorProvider>
</SlotFillProvider>
<GestureHandlerRootView style={ { flex: 1 } }>
<SlotFillProvider>
<EditorProvider
settings={ editorSettings }
post={ normalizedPost }
initialEdits={ initialEdits }
useSubRegistry={ false }
{ ...props }
>
<Layout setTitleRef={ this.setTitleRef } />
</EditorProvider>
</SlotFillProvider>
</GestureHandlerRootView>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ dependencies {
implementation "org.wordpress-mobile:react-native-clipboard:${extractPackageVersion(packageJson, '@react-native-clipboard/clipboard', 'dependencies')}"
implementation "org.wordpress-mobile:react-native-fast-image:${extractPackageVersion(packageJson, 'react-native-fast-image', 'dependencies')}"

implementation("com.github.wordpress-mobile:react-native-gesture-handler:${extractPackageVersion(packageJson, 'react-native-gesture-handler', 'dependencies')}", {
// implementation("com.github.wordpress-mobile:react-native-gesture-handler:${extractPackageVersion(packageJson, 'react-native-gesture-handler', 'dependencies')}", {
implementation("com.github.wordpress-mobile:react-native-gesture-handler:wp-fork-2.5.0-SNAPSHOT", {
// Remove Reanimated transitive dependency as it's already defined here
exclude group: 'com.github.wordpress-mobile', module: 'react-native-reanimated'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import com.reactnativecommunity.slider.ReactSliderPackage;
import org.linusu.RNGetRandomValuesPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import com.swmansion.gesturehandler.RNGestureHandlerPackage;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
import com.swmansion.reanimated.ReanimatedPackage;
Expand Down Expand Up @@ -615,7 +614,7 @@ public void onCreateView(Context initContext,
mIsDarkMode = gutenbergProps.isDarkMode();
mExceptionLogger = exceptionLogger;
mBreadcrumbLogger = breadcrumbLogger;
mReactRootView = new RNGestureHandlerEnabledRootView(new MutableContextWrapper(initContext));
mReactRootView = new ReactRootView(new MutableContextWrapper(initContext));
mReactRootView.setBackgroundColor(colorBackground);

ReactInstanceManagerBuilder builder =
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native-editor/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ dependencies {
implementation "org.wordpress-mobile:react-native-clipboard:${extractPackageVersion(packageJson, '@react-native-clipboard/clipboard', 'dependencies')}"
implementation "org.wordpress-mobile:react-native-fast-image:${extractPackageVersion(packageJson, 'react-native-fast-image', 'dependencies')}"

implementation("com.github.wordpress-mobile:react-native-gesture-handler:${extractPackageVersion(packageJson, 'react-native-gesture-handler', 'dependencies')}", {
// implementation("com.github.wordpress-mobile:react-native-gesture-handler:${extractPackageVersion(packageJson, 'react-native-gesture-handler', 'dependencies')}", {
implementation("com.github.wordpress-mobile:react-native-gesture-handler:wp-fork-2.5.0-SNAPSHOT", {
// Remove Reanimated transitive dependency as it's already defined here
exclude group: 'com.github.wordpress-mobile', module: 'react-native-reanimated'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

import org.wordpress.mobile.WPAndroidGlue.GutenbergProps;

Expand All @@ -27,11 +25,6 @@ protected String getMainComponentName() {
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}

@Nullable
@Override
protected Bundle getLaunchOptions() {
Expand Down

0 comments on commit 872b85c

Please sign in to comment.