• Register
1 vote

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 />

Please let me know how can I fix this issue?

8 4
5,680 points

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.

8 5 2
3,230 points

Related questions

0 votes
1 answer 2.8K views
Problem : I am trying to use the native base for making app in the react-native. I am very new to both things. When I try to run the app It gives me below error: &ldquo;Module appregistry is not a registered callable module (calling runapplication)&rdquo;Below is my code for ... </Header>             </Container>         );     } } My native-base version is as follows "native-base": "^2.1.2"
asked Jan 9 alecxe 7.5k points
0 votes
1 answer 251 views
Problem : I am learning React. I have written the below myrender method in my React Native code: myrender() { const {height, width} = Dimensions.get('window'); return ( <View style={styles.container}> <Image style={{ height:height, width:width, }} source ... But it is giving me below error &ldquo;React.Children.only expected to receive a single React element child&rdquo; How can I fix above error?
asked Mar 3 mphil 2.3k points
0 votes
1 answer 378 views
Problem : I am getting error while using ggplot2 to plot the graphs error in usemethod("depth") : no applicable method for 'depth' applied to an object of class "null"
asked Nov 7, 2019 peterlaw 6.9k points