0.13.0-rc1
version of the react
and react-tools
in npm and react
in bower.props
after the item has been created is deprecated. In dev mode you will get a warning; future versions of React will include optimizations, assuming props
is a constant.statics
) are no longer automatically bound to the component.componentDidMount
method; this change will be noticeable if your component calls the parent callback inside the componentDidMount
, and this is an anti-pattern and this should be avoided no matter what.setState
now always applied in batch mode, which means asynchronous. Previously, the first call, at the first connection (mount) of the component was synchronous.setState
and forceUpdate
on the unmounted component now throws a warning instead of an exception. This helps to avoid problems with productivity in promises.this._pendingState
and this._rootNodeID
.React.findDOMNode(component)
, it should be used instead of component.getDOMNode()
. The base class for components based on ES6 classes does not have a getDOMNode
method.ref
will allow the use of a callback instead of the name: <Photo ref={(c) => this._photo = c} />
so you can refer to the component with this._photo
(instead of ref="photo"
that will give this.refs.photo
)this.setState()
method can be a function for transactional state updates, for example this.setState((state, props) => ({count: state.count + 1}));
This means that you no longer need to use this._pendingState
, which no longer exists.this.props.children
.ComponentClass.type
deprecated. Just use ComponentClass
, usually like this: element.type === ComponentClass
createClass
have been removed or obsolete due to ES6 classes, for example: getDOMNode
, setProps
, replaceState
.React.addons.classSet
deprecated. This functionality may be replaced by some freely available modules. For example, classnames is one of these modules.class
methods are no longer enumerable by default; this is a requirement of Object.defineProperty
; if you support browsers like IE8, you can use the flag--target es3
, which will restore the old behavior.--target
option for the jsx command allows you to specify the ECMAScript version.es5
by default.es3
restores the previous default behavior. Also makes using reserved words safe, for example this.static
will be replaced by this['static']
for compatibility with IE8.>
or }
inside an element. Previously, this was transformed into a string, now it will be a parsing error. We will release a tool to find and fix potential problems in the JSX code.Source: https://habr.com/ru/post/251467/
All Articles