Skip to content
/ Box Public

使用ReactNative ^0.25.1 && React ^0.14.8 开发的demo,运行环境IOS

Notifications You must be signed in to change notification settings

xingdalee/Box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

语法速查

各功能模块介绍以及部分API见Wiki

打离线包

1、将AppDelegate.m中的 jsCodeLocation = [NSURL URLWithString:@"http://192.168.2.62:8081/index.ios.bundle?platform=ios&dev=true"]; 注释掉

2、将// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 注释放开

3、在终端执行:react-native bundle --minify --entry-file index.ios.js --bundle-output main.jsbundle

4、Xcode中Command+R运行即可

掉坑总结

1、npm只使用电脑自带‘终端’ 绝对不在使用第三方工具;

2、npm时必须系统全局翻墙;

3、遇到Xcode编译错误时,如果怀疑是npm下载数据不完整的问题,必须 sudo npm cache clean;

报错信息与解决方法

  • 类似于这样循环时报错(/box/ShoppingCart):Each child in an array or iterator should have a unique "key" prop. Check the render method of List. See https://fb.me/react-warning-keys for more information.

只要在中加上key={i}就可以了

  • CameraRoll Cannot read property 'getPhotos' of undefined

CameraRollErr

在libraries上右击添加node_modules/react-native/CameraRoll/RCTCameraRoll.xcodeproj,并点击RCTCameraRoll.xcodeproj 选择'Build Phases',点击Link Binary With libraries添加 libRCTCameraRoll.a ,重启模拟器即可,相关资料:facebook/react-native#4560

  • Failed propType: Invalid props.style key fontSize supplied to View

不可以给View组件fontSize属性,尽量把这个属性给Text

About

使用ReactNative ^0.25.1 && React ^0.14.8 开发的demo,运行环境IOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published