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

前端 未结 20 807
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:07

    Even though react-native-gesture-handler is present in node_modules folder, we need to add it to path or install it again. Then link with native code.

    1) npm install --save react-native-gesture-handler

    success Saved 1 new dependency.
    info Direct dependencies
    └─ react-native-gesture-handler@1.0.15
    info All dependencies
    └─ react-native-gesture-handler@1.0.15
    

    2) react-native link

    rnpm-install info Linking react-native-gesture-handler ios dependency 
    rnpm-install info Platform 'ios' module react-native-gesture-handler has been
     successfully linked 
    rnpm-install info Linking react-native-gesture-handler android dependency 
    rnpm-install info Platform 'android' module react-native-gesture-handler has
     been successfully linked
    

    3) react-native run-android or react-native run-ios

提交回复
热议问题