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

前端 未结 20 833
Happy的楠姐
Happy的楠姐 2020-12-01 04:43

I have installed react-navigation in my React Native project. Its a starter project doesn\'t have any codes. But while running project I am facing

20条回答
  •  长情又很酷
    2020-12-01 05:12

    From the official doc:

    If you're on React Native >= 0.60, you need to disable autolinking for react-native-gesture-handler first. To disable autolinking for it, create a react-native.config.js file in the root of your project with the following content:

    module.exports = {
      dependencies: {
        'react-native-gesture-handler': {
          platforms: {
            android: null,
            ios: null,
          },
        },
      },
    };
    

    If your are using React 0.60, just omit this official doc. Follow following steps:

    1. rm react-native.config.js if exist
    2. react-native link react-native-gesture-handler
    3. cd ios && pod install && cd ..
    4. react-native run-ios

提交回复
热议问题