undefined is not an object (evaluating 'RNGestureHandlerModule.State')

Error while installing React Navigation

Sun, 06 Jan 2019

This happens when you install and use React Navigation without Expo. Ever since React Navigation 3 came out it needs react-native-gesture-handler in order to work. This error usually pops up if Gesture Handler isn’t linked properly. Follows these steps to fix it.

  1. remove node_modules and package-lock.json
  2. cd to ios and clear your pods and build folder
  3. cd back to your root project directory
  4. npm install
  5. npm install —save react-navigation
  6. npm install —save react-native-gesture-handler
  7. react-native link
  8. install all modules with npm install
  9. cd back to ios
  10. pod install
  11. cd back to root
  12. npm run ios

After these steps your project should start to build and run properly again.

Buy Me A CoffeeDigitalOcean Referral Badge
Loading...
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.

DigitalOcean Referral Badge