React v0.12 发布,此版本引入了新术语;修改了 APIs,使得 React 一些概念更简洁。 同时还对 JSX 做了一些修改,飞起了一些函数。
此版本现已提供下载:
React
Dev build with warnings: http://fb.me/react-0.12.0.js
Minified build for production: http://fb.me/react-0.12.0.min.js
React with Add-Ons
Dev build with warnings: http://fb.me/react-with-addons-0.12.0.js
Minified build for production: http://fb.me/react-with-addons-0.12.0.min.js
In-Browser JSX transformer
http://fb.me/JSXTransformer-0.12.0.js
React 团队通过发布了 react
和 react-tools
0.12.0
包到 npm 和 react
包到 bower。
更多内容请看这里。
key
and ref
moved off props object, now accessible on the element directly
React is now BSD licensed with accompanying Patents grant
Default prop resolution has moved to Element creation time instead of mount time, making them effectively static
React.__internals
is removed - it was exposed for DevTools which no longer needs access
Composite Component functions can no longer be called directly - they must be wrapped with React.createFactory
first. This is handled for you when using JSX.
Spread operator ({...}
) introduced to deprecate this.transferPropsTo
Added support for more HTML attributes: acceptCharset
, classID
, manifest
React.renderComponent
--> React.render
React.renderComponentToString
--> React.renderToString
React.renderComponentToStaticMarkup
--> React.renderToStaticMarkup
React.isValidComponent
--> React.isValidElement
React.PropTypes.component
--> React.PropTypes.element
React.PropTypes.renderable
--> React.PropTypes.node
DEPRECATED React.isValidClass
DEPRECATED instance.transferPropsTo
DEPRECATED Returning false
from event handlers to preventDefault
DEPRECATED Convenience Constructor usage as function, instead wrap with React.createFactory
DEPRECATED use of key={null}
to assign implicit keys
Better handling of events and updates in nested results, fixing value restoration in "layered" controlled components
Correctly treat event.getModifierState
as case sensitive
Improved normalization of event.charCode
Better error stacks when involving autobound methods
Removed DevTools message when the DevTools are installed
Correctly detect required language features across browsers
Fixed support for some HTML attributes:
list
updates correctly now
scrollLeft
, scrollTop
removed, these should not be specified as props
Improved error messages
React.addons.batchedUpdates
added to API for hooking into update cycle
React.addons.update
uses assign
instead of copyProperties
which does hasOwnProperty
checks. Properties on prototypes will no longer be updated correctly.
Fixed some issues with CSS Transitions
Enforced convention: lower case tag names are always treated as HTML tags, upper case tag names are always treated as composite components
JSX no longer transforms to simple function calls
@jsx React.DOM
no longer required
spread ({...}
) operator introduced to allow easier use of props
JSXTransformer: Make sourcemaps an option when using APIs directly (eg, for react-rails)
React.js 是 Facebook 推出的一个用来构建用户界面的 JavaScript 库。
Facebook开源了React,这是该公司用于构建反应式图形界面的JavaScript库,已经应用于构建Instagram网站及 Facebook部分网站。最近出现了AngularJS、MeteorJS 和Polymer中实现的Model-Driven Views等框架,React也顺应了这种趋势。React基于在数据模型之上声明式指定用户界面的理念,用户界面会自动与底层数据保持同步。与前面提及 的框架不同,出于灵活性考虑,React使用JavaScript来构建用户界面,没有选择HTML。