Fix: updated with new docs links (#8049)
This commit is contained in:
committed by
Dan Abramov
parent
37f94bd3bb
commit
6810627a91
@@ -388,7 +388,7 @@ Each of these changes will continue to work as before with a new warning until t
|
||||
|
||||
- `React.initializeTouchEvents` is no longer necessary and has been removed completely. Touch events now work automatically.
|
||||
- Add-Ons: Due to the DOM node refs change mentioned above, `TestUtils.findAllInRenderedTree` and related helpers are no longer able to take a DOM component, only a custom component.
|
||||
- The `props` object is now frozen, so mutating props after creating a component element is no longer supported. In most cases, [`React.cloneElement`](https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement) should be used instead. This change makes your components easier to reason about and enables the compiler optimizations mentioned above.
|
||||
- The `props` object is now frozen, so mutating props after creating a component element is no longer supported. In most cases, [`React.cloneElement`](https://facebook.github.io/react/docs/react-api.html#cloneelement) should be used instead. This change makes your components easier to reason about and enables the compiler optimizations mentioned above.
|
||||
- Plain objects are no longer supported as React children; arrays should be used instead. You can use the [`createFragment`](https://facebook.github.io/react/docs/create-fragment.html) helper to migrate, which now returns an array.
|
||||
- Add-Ons: `classSet` has been removed. Use [classnames](https://github.com/JedWatson/classnames) instead.
|
||||
- Web components (custom elements) now use native property names. Eg: `class` instead of `className`.
|
||||
@@ -399,7 +399,7 @@ Each of these changes will continue to work as before with a new warning until t
|
||||
- `setProps` and `replaceProps` are now deprecated. Instead, call ReactDOM.render again at the top level with the new props.
|
||||
- ES6 component classes must now extend `React.Component` in order to enable stateless function components. The [ES3 module pattern](https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#other-languages) will continue to work.
|
||||
- Reusing and mutating a `style` object between renders has been deprecated. This mirrors our change to freeze the `props` object.
|
||||
- Add-Ons: `cloneWithProps` is now deprecated. Use [`React.cloneElement`](https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement) instead (unlike `cloneWithProps`, `cloneElement` does not merge `className` or `style` automatically; you can merge them manually if needed).
|
||||
- Add-Ons: `cloneWithProps` is now deprecated. Use [`React.cloneElement`](https://facebook.github.io/react/docs/react-api.html#cloneelement) instead (unlike `cloneWithProps`, `cloneElement` does not merge `className` or `style` automatically; you can merge them manually if needed).
|
||||
- Add-Ons: To improve reliability, `CSSTransitionGroup` will no longer listen to transition events. Instead, you should specify transition durations manually using props such as `transitionEnterTimeout={500}`.
|
||||
|
||||
### Notable enhancements
|
||||
|
||||
@@ -55,7 +55,7 @@ function forEachSingleChild(bookKeeping, child, name) {
|
||||
/**
|
||||
* Iterates through children that are typically specified as `props.children`.
|
||||
*
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
|
||||
* See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
|
||||
*
|
||||
* The provided forEachFunc(child, index) will be called for each
|
||||
* leaf child.
|
||||
@@ -148,7 +148,7 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
||||
/**
|
||||
* Maps children that are typically specified as `props.children`.
|
||||
*
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
|
||||
* See https://facebook.github.io/react/docs/react-api.html#react.children.map
|
||||
*
|
||||
* The provided mapFunction(child, key, index) will be called for each
|
||||
* leaf child.
|
||||
@@ -177,7 +177,7 @@ function forEachSingleChildDummy(traverseContext, child, name) {
|
||||
* Count the number of children that are typically specified as
|
||||
* `props.children`.
|
||||
*
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
|
||||
* See https://facebook.github.io/react/docs/react-api.html#react.children.count
|
||||
*
|
||||
* @param {?*} children Children tree container.
|
||||
* @return {number} The number of children.
|
||||
@@ -191,7 +191,7 @@ function countChildren(children, context) {
|
||||
* Flatten a children object (typically specified as `props.children`) and
|
||||
* return an array with appropriately re-keyed children.
|
||||
*
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
|
||||
* See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
|
||||
*/
|
||||
function toArray(children) {
|
||||
var result = [];
|
||||
|
||||
@@ -18,7 +18,7 @@ var invariant = require('invariant');
|
||||
* Returns the first child in a collection of children and verifies that there
|
||||
* is only one child in the collection.
|
||||
*
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
|
||||
* See https://facebook.github.io/react/docs/react-api.html#react.children.only
|
||||
*
|
||||
* The current implementation of this function assumes that a single child gets
|
||||
* passed without a wrapper, but the purpose of this helper function is to
|
||||
|
||||
@@ -761,7 +761,7 @@ var ReactClass = {
|
||||
|
||||
/**
|
||||
* Creates a composite component class given a class specification.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
|
||||
* See https://facebook.github.io/react/docs/react-api.html#createclass
|
||||
*
|
||||
* @param {object} spec Class specification (which must define `render`).
|
||||
* @return {function} Component constructor function.
|
||||
|
||||
@@ -178,7 +178,7 @@ var ReactElement = function(type, key, ref, self, source, owner, props) {
|
||||
|
||||
/**
|
||||
* Create and return a new ReactElement of the given type.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
|
||||
* See https://facebook.github.io/react/docs/react-api.html#createelement
|
||||
*/
|
||||
ReactElement.createElement = function(type, config, children) {
|
||||
var propName;
|
||||
@@ -266,7 +266,7 @@ ReactElement.createElement = function(type, config, children) {
|
||||
|
||||
/**
|
||||
* Return a function that produces ReactElements of a given type.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
|
||||
* See https://facebook.github.io/react/docs/react-api.html#createfactory
|
||||
*/
|
||||
ReactElement.createFactory = function(type) {
|
||||
var factory = ReactElement.createElement.bind(null, type);
|
||||
@@ -295,7 +295,7 @@ ReactElement.cloneAndReplaceKey = function(oldElement, newKey) {
|
||||
|
||||
/**
|
||||
* Clone and return a new ReactElement using element as the starting point.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
|
||||
* See https://facebook.github.io/react/docs/react-api.html#cloneelement
|
||||
*/
|
||||
ReactElement.cloneElement = function(element, config, children) {
|
||||
var propName;
|
||||
@@ -370,7 +370,7 @@ ReactElement.cloneElement = function(element, config, children) {
|
||||
|
||||
/**
|
||||
* Verifies the object is a ReactElement.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
|
||||
* See https://facebook.github.io/react/docs/react-api.html#isvalidelement
|
||||
* @param {?object} object
|
||||
* @return {boolean} True if `object` is a valid component.
|
||||
* @final
|
||||
|
||||
@@ -540,7 +540,7 @@ var ReactMount = {
|
||||
|
||||
/**
|
||||
* Renders a React component into the DOM in the supplied `container`.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
|
||||
* See https://facebook.github.io/react/docs/react-dom.html#render
|
||||
*
|
||||
* If the React component was previously rendered into `container`, this will
|
||||
* perform an update on it and only mutate the DOM as necessary to reflect the
|
||||
@@ -557,7 +557,7 @@ var ReactMount = {
|
||||
|
||||
/**
|
||||
* Unmounts and destroys the React component rendered in the `container`.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
|
||||
* See https://facebook.github.io/react/docs/react-dom.html#unmountcomponentatnode
|
||||
*
|
||||
* @param {DOMElement} container DOM element containing a React component.
|
||||
* @return {boolean} True if a component was found in and unmounted from
|
||||
|
||||
@@ -22,7 +22,7 @@ var warning = require('warning');
|
||||
/**
|
||||
* Returns the DOM node rendered by this element.
|
||||
*
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
|
||||
* See https://facebook.github.io/react/docs/react-dom.html#finddomnode
|
||||
*
|
||||
* @param {ReactComponent|DOMElement} componentOrElement
|
||||
* @return {?DOMElement} The root node of this element.
|
||||
|
||||
@@ -77,7 +77,7 @@ function renderToStringImpl(element, makeStaticMarkup) {
|
||||
/**
|
||||
* Render a ReactElement to its initial HTML. This should only be used on the
|
||||
* server.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring
|
||||
* See https://facebook.github.io/react/docs/react-dom-server.html#rendertostring
|
||||
*/
|
||||
function renderToString(element) {
|
||||
invariant(
|
||||
@@ -90,7 +90,7 @@ function renderToString(element) {
|
||||
/**
|
||||
* Similar to renderToString, except this doesn't create extra DOM attributes
|
||||
* such as data-react-id that React uses internally.
|
||||
* See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup
|
||||
* See https://facebook.github.io/react/docs/react-dom-server.html#rendertostaticmarkup
|
||||
*/
|
||||
function renderToStaticMarkup(element) {
|
||||
invariant(
|
||||
|
||||
Reference in New Issue
Block a user