Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"RNGestureHandlerRootView" was not found in the UIManager

I need to fix this error.

Invariant Violation: requireNativeComponent: "RNGestureHandlerRootView" was not found in the UIManager.

This error is located at: in RNGestureHandlerRootView (created by GestureHandlerRootView) in GestureHandlerRootView (created by StackView) in StackView (created by StackView) in StackView in Unknown (created by Navigator) in Navigator (created by SceneView) in SceneView (created by SwitchView) in SwitchView (created by Navigator) in Navigator (created by NavigationContainer) in NavigationContainer (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer

like image 948
Roshan Wickramasooriya Avatar asked Sep 09 '25 17:09

Roshan Wickramasooriya


2 Answers

Recently I had the same problem. Here's the solution:

expo install react-native-gesture-handler

and

import 'react-native-gesture-handler';

On the root of the Project, the App.js file probably.

Try to use the documentation, it can be found here, and it's how I resolved this issue: https://reactnavigation.org/docs/getting-started/

like image 92
Lucas Fernandes Avatar answered Sep 13 '25 01:09

Lucas Fernandes


1. Update dependencies with expo

On an existing Expo project some dependencies versions installed by you may be incompatible with Expo. This causes such errors. To fix this issue you need the right versions of those dependencies. Run the following command to remove the incompatible versions and install the supported versions as required by Expo.

expo update

Confirm the action with Y if it prompts your approval. Then restart your app. This will fix the issue.

2. Install required dependencies

If you don't have react-native-gesture-handler installed in your project, install it.

  • If you install it with expo you may not require to follow the step 1 above.
expo install react-native-gesture-handler

  • But if you install it through npm or yarn you also need to follow the step 1 above.
npm install react-native-gesture-handler
  • To import it in App.js/ App.tsx, place it in the first line of the file, or use as required:
import 'react-native-gesture-handler';
like image 35
TradeCoder Avatar answered Sep 13 '25 00:09

TradeCoder