React v0.12 发布,此版本引入了新术语;修改了 APIs,使得 React 一些概念更简洁。 同时还对 JSX 做了一些修改,飞起了一些函数。
此版本现已提供下载:
React 团队通过发布了 react 和 react-tools 0.12.0 包到 npm 和 react 包到 bower。 更多内容请看这里。
ChangelogReact Core重大改进
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 withReact.createFactory DEPRECATED use of key={null} to assign implicit keys
Bug 修复
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 With Addons新特性重大改进Bug 修复
JSX重大改进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
新特性Bug 修复React.js 是 Facebook 推出的一个用来构建用户界面的 JavaScript 库。 Facebook开源了React,这是该公司用于构建反应式图形界面的JavaScript库,已经应用于构建Instagram网站及 Facebook部分网站。最近出现了AngularJS、MeteorJS 和Polymer中实现的Model-Driven Views等框架,React也顺应了这种趋势。React基于在数据模型之上声明式指定用户界面的理念,用户界面会自动与底层数据保持同步。与前面提及 的框架不同,出于灵活性考虑,React使用JavaScript来构建用户界面,没有选择HTML。 |