react-native踩坑

2017-03-24  本文已影响307人  我不是死胖子

could not get batchedbridge make sure

npm安装模块出错 ERRWindowNT6.1.7601

    npm config set proxy null
    npm config set https-proxy null
    npm config set strict-ssl false
* 成功
* > 参考自[https://segmentfault.com/q/1010000006696165/a-1020000006779353](https://segmentfault.com/q/1010000006696165/a-1020000006779353)

图片变动需要新启动packager

react-native-router-flux

修改项目目录

修改tabbar背景色为透明

tabBarOptions: {...
    indicatorStyle: {
        backgroundColor: 'transparent'
    },
}   

参考自https://github.com/react-community/react-navigation/issues/788

修改tabbar图标与文字间距

执行结果为上一次的代码

react-native-swiper

循环时需要加key

引入项目

//模块
class MyModule
...
export default MyModule;//export default也可以放在类名前(推荐)

//引入
import moduleA from './.../MyModule'
class Home...
<MyModule>

弃:

export default class MyModule
...
module.expoports = MyModule;
var moduleA = require('./.../MyModule');

用StyleSheet.hairlineWidth代替小于1的尺寸

过时

ES6

object object

三方包的问题,优先找github上的issues

Unable to resolve module react/lib/ReactComponentWithPureRenderMixin

上一篇下一篇

猜你喜欢

热点阅读