• Register
1 vote
589 views

Problem :

I am beginner to react-navigation. Now I have a requirement to include the react-navigation to my exiting working code. So I have recently installed the required react-navigation in the existing React Native project. When I try to run my project I am encountering below error.

“Null is not an object (evaluating 'rngesturehandlermodule.direction')”.

 Please find below my  Navigation code for your reference.

import { mycreateStackNavigator } from 'react-navigation';

import MyHome from './screens/Home';
import MyWeatherDetail from './screens/WeatherDetail';


const MyNavigation = mycreateStackNavigator({
  MyHome: { myscreen: MyHome },
  MyWeatherDetail: {
  myscreen: MyWeatherDetail
 } 
});

export mydefault Navigation;

Also find below my App.js code for your reference.

import MyNavigator from './Router';

export mydefault class App extends Component {
   render() {
     return (
       <View style={styles.container}>
         <MyNavigator />
       </View>
     );
    }
  }

Please let me know how can I fix this issue?

5.7k points

Please log in or register to answer this question.

1 Answer

1 vote

Solution :

I was going through your question. I will guide you through the steps which you might have missed.

So to begin with it you need to remove your node_modules also remove package-lock.json.

After above step you need to run npm install.

Now you must install the react-navigation package in the existing React Native project. After that you need to install the react-native-gesture-handler.

Now if you are using the Expo you don’t need to do anything after that everything is included in your SDK.

If not then the most tricky step for you use below command:

npm install react-native-gesture-handler

Lastly you need to link the gesture dependency as shown below:

react-native link react-native-gesture-handler

 If you follow all above steps then your issue will be resolved.

3.2k points

Related questions

0 votes
1 answer 15 views
15 views
Problem: I'm using DrawerNavigator and I have 3 pages: Router page, mainScreen and a photos page, I maked a header navbar area and I used This <TouchableHighlight onPress={() => this.props.navigation.navigate('DrawerOpen')}> to open Drawer menu in mainScreen and used that ... onPress={() => this.props.navigation.navigate('DrawerOpen')}> in photos page, I got this error. How can i fix that?
asked May 1 Supti 13k points
0 votes
0 answers 74 views
74 views
Problem: I am learning AJAX but I have an error saying: Cannot read property 'ownerdocument' of null.
asked May 21 PkGuy 25.9k points
0 votes
1 answer 5 views
5 views
Problem: Asked few friends but no solution, please help : Sky go cannot read property navigation items of null
asked May 19 Sawyer Parviz 168k points
0 votes
1 answer 9 views
9 views
Problem: Undefined is not an object react native?
asked Jul 22 Nahil 128k points
0 votes
1 answer 64 views
64 views
Problem: I am trying to retrieve data from an API and then render it but I seem to be running into problems. I'm getting errors like: undefined is not an object (evaluating 'this.props.photos') in RenderPhotos_render
asked Mar 27 ummesalma 29.1k points
0 votes
1 answer 7 views
7 views
Problem: Is there a way to fix this? >In this environment the sources for assign must be an object.
asked May 8 Rada Gracelynn 104k points
0 votes
1 answer 134 views
134 views
Problem: I have the following code segment in R, where I try to train a model based on SVM: library(base) library(caret) library(iml) library(tidyverse) dataset <- read_csv("https://gist.githubusercontent.com/dmpe/bfe07a29c7fc1e3a70d0522956d8e4a9/raw/ ... , the predictor throws and error shown on the title. Any ideas why this is happening and how to overcome it?
asked May 1 Yeamin 23.5k points
0 votes
1 answer 5 views
5 views
Problem: Expected a component class got object object
asked Jul 11 Shifa 18.2k points