When developing a React Native project on my Mac, I fall into a problem when running npm run ios
. My project is using some third-party libraries.
The Error
The message:
Null is not an object (evaluating ‘_RNGestureHandlerModule.default.Direction’)
Screenshot:
The Solution
The reason that causes the above error is that I forget to install the pods. To solve this, run the following command:
npx pod-install ios
If you still face this error, try:
npx react-native link
Finally, restart the metro bundler as well as the iOS simulator to make sure it works fine.
That’s it. Further reading:
- How to Create a Confirm Dialog in React Native
- How to Get Platform Information in React Native
- Working with CheckBox in React Native
- React Native: How to make rounded corners TextInput
- How to create circle images in React Native
You can also check our React topic page and React Native topic page for the latest tutorials and examples.