• Register
1 vote
440 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?

8 4
5,680 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.

8 5 2
3,230 points

Related questions

0 votes
1 answer 3.5K views
3.5K 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, 2020 alecxe 7.5k points
0 votes
6 answers 37 views
37 views
I need some React Native interview questions. It will be great if you can provide different categories. Thank You!
asked Dec 1, 2020 Lucky Guy 930 points
0 votes
1 answer 490 views
490 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, 2020 mphil 2.3k points
0 votes
1 answer 561 views
561 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
0 votes
1 answer 17 views
17 views
I'm getting an 'object is not an instance of declaring class' error. Any ideas?
asked Dec 19, 2020 TeamScript 11.1k points
0 votes
1 answer 6 views
6 views
Problem I need to check whether the object is null. In case it is not null process it, otherwise cancel processing. I am doing it this way: if (!price.Equals(null)) But I get NullReferenceException. If the object is null it just should not enter the if block. Obviously ... .Add(price); success = ProcessPrice(price); } } catch (Exception e) { throw new Exception(e.ToString()); } return success; }
asked Nov 6, 2020 alexh 2.2k points
0 votes
1 answer 27 views
27 views
I tried to execute the methods of a null object.and i write a program given bellow and in this program i failed to call the method: { public String getName() { return "Not Available"; } public boolean isNull() { return true; } } public class main { public static void main ( ... ){ system.out.println(emp1.getname()); } } what is wrong in my code and how can I check if a object is null in java?
asked Mar 16, 2020 LizzyM 6.1k points
0 votes
1 answer 27 views
27 views
Problem Hey, I have a minor curiosity that we can identify that the pointer is null or non-null.
asked Nov 20, 2020 chris jordan 2.2k points