Releases: facebook/react
Releases · facebook/react
v0.13.1
React Core
Bug Fixes
- Don't throw when rendering empty
<select>elements - Ensure updating
styleworks when transitioning fromnull
React with Add-Ons
Bug Fixes
- TestUtils: Don't warn about
getDOMNodefor ES6 classes - TestUtils: Ensure wrapped full page components (
<html>,<head>,<body>) are treated as DOM components - Perf: Stop double-counting DOM components
React Tools
Bug Fixes
- Fix option parsing for
--non-strict-es6module
v0.13.0
React Core
Breaking Changes
- Deprecated patterns that warned in 0.12 no longer work: most prominently, calling component classes without using JSX or React.createElement and using non-component functions with JSX or createElement
- Mutating
propsafter an element is created is deprecated and will cause warnings in development mode; future versions of React will incorporate performance optimizations assuming that props aren't mutated - Static methods (defined in
statics) are no longer autobound to the component class refresolution order has changed slightly such that a ref to a component is available immediately after itscomponentDidMountmethod is called; this change should be observable only if your component calls a parent component's callback within yourcomponentDidMount, which is an anti-pattern and should be avoided regardless- Calls to
setStatein life-cycle methods are now always batched and therefore asynchronous. Previously the first call on the first mount was synchronous. setStateandforceUpdateon an unmounted component now warns instead of throwing. That avoids a possible race condition with Promises.- Access to most internal properties has been completely removed, including
this._pendingStateandthis._rootNodeID.
New Features
- Support for using ES6 classes to build React components; see the v0.13.0 beta 1 notes for details.
- Added new top-level API
React.findDOMNode(component), which should be used in place ofcomponent.getDOMNode(). The base class for ES6-based components will not havegetDOMNode. This change will enable some more patterns moving forward. - Added a new top-level API
React.cloneElement(el, props)for making copies of React elements – see the v0.13 RC2 notes for more details. - New
refstyle, allowing a callback to be used in place of a name:<Photo ref={(c) => this._photo = c} />allows you to reference the component withthis._photo(as opposed toref="photo"which givesthis.refs.photo). this.setState()can now take a function as the first argument for transactional state updates, such asthis.setState((state, props) => ({count: state.count + 1}));– this means that you no longer need to usethis._pendingState, which is now gone.- Support for iterators and immutable-js sequences as children.
Deprecations
ComponentClass.typeis deprecated. Just useComponentClass(usually aselement.type === ComponentClass).- Some methods that are available on
createClass-based components are removed or deprecated from ES6 classes (getDOMNode,replaceState,isMounted,setProps,replaceProps).
React with Add-Ons
New Features
React.addons.createFragmentwas added for adding keys to entire sets of children.
Deprecations
React.addons.classSetis now deprecated. This functionality can be replaced with several freely available modules. classnames is one such module.- Calls to
React.addons.cloneWithPropscan be migrated to useReact.cloneElementinstead – make sure to mergestyleandclassNamemanually if desired.
React Tools
Breaking Changes
- When transforming ES6 syntax,
classmethods are no longer enumerable by default, which requiresObject.defineProperty; if you support browsers such as IE8, you can pass--target es3to mirror the old behavior
New Features
--targetoption is available on the jsx command, allowing users to specify and ECMAScript version to target.es5is the default.es3restores the previous default behavior. An additional transform is added here to ensure the use of reserved words as properties is safe (egthis.staticwill becomethis['static']for IE8 compatibility).
- The transform for the call spread operator has also been enabled.
JSX
Breaking Changes
- A change was made to how some JSX was parsed, specifically around the use of
>or}when inside an element. Previously it would be treated as a string but now it will be treated as a parse error. Thejsx_orphaned_brackets_transformerpackage on npm can be used to find and fix potential issues in your JSX code.
v0.13.0-rc2
v0.13.0-rc2
v0.13.0-rc1
v0.13.0-rc1
v0.12.2
React Core
- Added support for more HTML attributes:
formAction,formEncType,formMethod,formTarget,marginHeight,marginWidth - Added
strokeOpacityto the list of unitless CSS properties - Removed trailing commas (allows npm module to be bundled and used in IE8)
- Fixed bug resulting in error when passing
undefinedtoReact.createElement- now there is a useful warning
React Tools
- JSX-related transforms now always use double quotes for props and
displayName
v0.12.1
React Tools
- Types transform updated with latest support
- jstransform version updated with improved ES6 transforms
- Explicit Esprima dependency removed in favor of using Esprima information exported by jstransform
v0.12.0
React Core
Breaking Changes
keyandrefmoved 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.__internalsis 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.createFactoryfirst. This is handled for you when using JSX.
New Features
- Spread operator (
{...}) introduced to deprecatethis.transferPropsTo - Added support for more HTML attributes:
acceptCharset,classID,manifest
Deprecations
React.renderComponent-->React.renderReact.renderComponentToString-->React.renderToStringReact.renderComponentToStaticMarkup-->React.renderToStaticMarkupReact.isValidComponent-->React.isValidElementReact.PropTypes.component-->React.PropTypes.elementReact.PropTypes.renderable-->React.PropTypes.node- DEPRECATED
React.isValidClass - DEPRECATED
instance.transferPropsTo - DEPRECATED Returning
falsefrom event handlers to preventDefault - DEPRECATED Convenience Constructor usage as function, instead wrap with
React.createFactory - DEPRECATED use of
key={null}to assign implicit keys
Bug Fixes
- Better handling of events and updates in nested results, fixing value restoration in "layered" controlled components
- Correctly treat
event.getModifierStateas 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:
listupdates correctly nowscrollLeft,scrollTopremoved, these should not be specified as props
- Improved error messages
React With Addons
New Features
React.addons.batchedUpdatesadded to API for hooking into update cycle
Breaking Changes
React.addons.updateusesassigninstead ofcopyPropertieswhich doeshasOwnPropertychecks. Properties on prototypes will no longer be updated correctly.
Bug Fixes
- Fixed some issues with CSS Transitions
JSX
Breaking Changes
- 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
New Features
@jsx React.DOMno longer required- spread (
{...}) operator introduced to allow easier use of props
Bug Fixes
- JSXTransformer: Make sourcemaps an option when using APIs directly (eg, for react-rails)
v0.12.0-rc1
v0.12.0-rc1
v0.11.2
React Core
New Features
- Added support for
<dialog>element and associatedopenattribute - Added support for
<picture>element and associatedmediaandsizesattributes - Added
React.createElementAPI in preparation for React v0.12React.createDescriptorhas been deprecated as a result
JSX
<picture>is now parsed intoReact.DOM.picture
React Tools
- Update
esprimaandjstransformfor correctness fixes - The
jsxexecutable now exposes a--strip-typesflag which can be used to remove TypeScript-like type annotations- This option is also exposed to
require('react-tools').transformasstripTypes
- This option is also exposed to
v0.11.1
React Core
Bug Fixes
setStatecan be called insidecomponentWillMountin non-DOM environmentsSyntheticMouseEvent.getEventModifierStatecorrectly renamed togetModifierStategetModifierStatecorrectly returns abooleangetModifierStateis now correctly case sensitive- Empty Text node used in IE8
innerHTMLworkaround is now removed, fixing rerendering in certain cases
JSX
- Fix duplicate variable declaration in JSXTransformer (caused issues in some browsers)