React Native 0.40 正式版发布
2017-01-05 by sunnylqm

原文地址

从0.18开始,RN默认项目全面转向ES6,语法大变化,请参考此贴学习 http://bbs.reactnative.cn/topic/15/

如何升级现有项目的RN版本?

从2017年开始,React Native的发布周期将由每两周一次改为每月一次。下一个版本(2017年1月版)将于1月底发布。

重大变更: iOS的原生头文件引用路径有变化!

This change affects all native modules and application code on iOS that refer to react native .h files

e1577df这一修改提交后,iOS的原生代码必须在react的命名空间下引用对应的头文件。在这之前的写法是:

#import "RCTUtils.h"

但现在必须改为:

#import <React/RCTUtils.h>

Also, for the new imports to work correctly, update the HEADER_SERACH_PATH to include $(BUILT_PRODUCTS_DIR)/include/** in your xcode project build settings.

**当然这意味着所有第三方的iOS原生组件都需要针对0.40版本进行修改。**This means that all iOS native libraries need a major version bump for RN 0.40. We attempt to minimize changes of this magnitude, and we apologize for any inconvenience caused。

require('image!...')的老式图片写法正式作废!

Support for require('image!…'), which has been deprecated for a long time, is now removed. If you are still loading images that way in your apps, make sure to check the documentation for alternatives.

getTransformModuleOptions is removed

If you were having custom rn-cli.config.js in your app and for some reason, using getTransformModuleOptions, make sure to check @davidaurelio commit <tt>ca58e0a</tt> for details on the changes.

Android

Bugfixes

New features and enhancements

iOS

Bugfixes

New features and enhancements

General

Bugfixes

New features and enhancements

[去论坛发表意见]