美文网首页
RN 各种坑

RN 各种坑

作者: _RG | 来源:发表于2019-10-29 11:40 被阅读0次
    1. Unable to resolve module @babel/runtime/helpers/objectSpread
    npm add @babel/runtime
    
    1. 执行 react-native run-ios

    报错
    Command run-ios unrecognized
    Usage: react-native <command>

    方法1 : 升级最新的react-native 版本
    npm install --save react-native@latest

    方法2: 查看版本并更新

    react-native -v

    react-native-cli: 2.0.1
    react-native: n/a - not inside a React Native project directory

    更新
    npm update

    更新完成后
    react-native -v

    react-native-cli: 2.0.1
    react-native: 0.61.2

    1. TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.Direction')

    主要是没有pod 安装第三库导致,在 react-navigation 4X版本, 需要cd到iOS下 执行pod install

    1. 如果是图片名字里面有 @3x ,加载image时需要去掉@3x
      例如
    
    //如果写 forntPage-search-grey@3x.png 就会报错
    
      <Image
            source={require('./images/forntPage-search-grey.png')}
            style={{ width: 30, height: 30 }}
         />
    
    
    

    相关文章

      网友评论

          本文标题:RN 各种坑

          本文链接:https://www.haomeiwen.com/subject/asxfuctx.html