react-refresh
0.19.0 · 9 Sep 2026MIT110M / weekRepositoryHomepagenpmAtom feed
0.19.0 is the newest release of 0.13.x.
In short
8 breaking5 deprecated9 new
- Breaking
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 - Breaking
Static methods (defined in
statics) are no longer autobound to the component class - Breaking
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 - Breaking
Calls to
setStatein life-cycle methods are now always batched and therefore asynchronous. Previously the first call on the first mount was synchronous. - Breaking
setStateandforceUpdateon an unmounted component now warns instead of throwing. That avoids a possible race condition with Promises. - Breaking
Access to most internal properties has been completely removed, including
this._pendingStateandthis._rootNodeID. - Breaking
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 - Breaking
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.
Release note
React Core
Breaking Changes
- Deprecated
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
- Breaking
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 - Breaking
Static methods (defined in
statics) are no longer autobound to the component class - Breaking
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 - Breaking
Calls to
setStatein life-cycle methods are now always batched and therefore asynchronous. Previously the first call on the first mount was synchronous. - Breaking
setStateandforceUpdateon an unmounted component now warns instead of throwing. That avoids a possible race condition with Promises. - Breaking
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
- Deprecated
ComponentClass.typeis deprecated. Just useComponentClass(usually aselement.type === ComponentClass). - Deprecated
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
- Deprecated
React.addons.classSetis now deprecated. This functionality can be replaced with several freely available modules. classnames is one such module. - Deprecated
Calls to
React.addons.cloneWithPropscan be migrated to useReact.cloneElementinstead – make sure to mergestyleandclassNamemanually if desired.
React Tools
Breaking Changes
- Breaking
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
- Breaking
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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.