diff --git a/docs/02-displaying-data.md b/docs/02-displaying-data.md index c0763ef3c..a133e4036 100644 --- a/docs/02-displaying-data.md +++ b/docs/02-displaying-data.md @@ -47,7 +47,7 @@ var HelloWorld = React.createClass({ }); setInterval(function() { - React.renderComponent( + React.render( , document.getElementById('example') ); diff --git a/docs/02-displaying-data.zh-CN.md b/docs/02-displaying-data.zh-CN.md index 5023a0000..c05548ce2 100644 --- a/docs/02-displaying-data.zh-CN.md +++ b/docs/02-displaying-data.zh-CN.md @@ -47,7 +47,7 @@ var HelloWorld = React.createClass({ }); setInterval(function() { - React.renderComponent( + React.render( , document.getElementById('example') ); diff --git a/docs/03-interactivity-and-dynamic-uis.md b/docs/03-interactivity-and-dynamic-uis.md index 975871f9d..5c437aedf 100644 --- a/docs/03-interactivity-and-dynamic-uis.md +++ b/docs/03-interactivity-and-dynamic-uis.md @@ -29,7 +29,7 @@ var LikeButton = React.createClass({ } }); -React.renderComponent( +React.render( , document.getElementById('example') ); diff --git a/docs/04-multiple-components.md b/docs/04-multiple-components.md index 74f25b235..9287306dc 100644 --- a/docs/04-multiple-components.md +++ b/docs/04-multiple-components.md @@ -48,7 +48,7 @@ var ProfileLink = React.createClass({ } }); -React.renderComponent( +React.render( , document.getElementById('example') ); diff --git a/docs/05-reusable-components.md b/docs/05-reusable-components.md index 3430a3488..7835c9a5a 100644 --- a/docs/05-reusable-components.md +++ b/docs/05-reusable-components.md @@ -100,19 +100,18 @@ The result of `getDefaultProps()` will be cached and used to ensure that `this.p ## Transferring Props: A Shortcut -A common type of React component is one that extends a basic HTML in a simple way. Often you'll want to copy any HTML attributes passed to your component to the underlying HTML element to save typing. React provides `transferPropsTo()` to do just this. +A common type of React component is one that extends a basic HTML in a simple way. Often you'll want to copy any HTML attributes passed to your component to the underlying HTML element to save typing. You can use the JSX _spread_ syntax to achieve this: ```javascript var CheckLink = React.createClass({ render: function() { - // transferPropsTo() will take any props passed to CheckLink - // and copy them to - return this.transferPropsTo({'√ '}{this.props.children}); + // This takes any props passed to CheckLink and copies them to + return {'√ '}{this.props.children}; } }); -React.renderComponent( - +React.render( + Click here! , document.getElementById('example') @@ -180,7 +179,7 @@ var TickTock = React.createClass({ } }); -React.renderComponent( +React.render( , document.getElementById('example') ); diff --git a/docs/07-working-with-the-browser.md b/docs/07-working-with-the-browser.md index 3b4966bf9..2a5a3e6a2 100644 --- a/docs/07-working-with-the-browser.md +++ b/docs/07-working-with-the-browser.md @@ -50,7 +50,7 @@ var MyComponent = React.createClass({ } }); -React.renderComponent( +React.render( , document.getElementById('example') ); diff --git a/docs/09.5-clone-with-props.md b/docs/09.5-clone-with-props.md index 778a4f717..ed35d6ac4 100644 --- a/docs/09.5-clone-with-props.md +++ b/docs/09.5-clone-with-props.md @@ -10,12 +10,12 @@ In rare situations a component may want to change the props of a component that #### `ReactComponent React.addons.cloneWithProps(ReactComponent component, object? extraProps)` -Do a shallow copy of `component` and merge any props provided by `extraProps`. Props are merged in the same manner as [`transferPropsTo()`](/react/docs/component-api.html#transferpropsto), so props like `className` will be merged intelligently. +Do a shallow copy of `component` and merge any props provided by `extraProps`. The `className` and `style` props will be merged intelligently. > Note: > -> `cloneWithProps` does not transfer the `key` prop to the cloned component. If you wish to preserve the key, add it to the `extraProps` object: +> `cloneWithProps` does not transfer `key` to the cloned component. If you wish to preserve the key, add it to the `extraProps` object: > ```js -> var clonedComponent = cloneWithProps(originalComponent, { key : originalComponent.props.key }); +> var clonedComponent = cloneWithProps(originalComponent, { key : originalComponent.key }); > ``` -> `ref` is another prop that is not preserved either. +> `ref` is similarly not preserved. diff --git a/docs/getting-started.md b/docs/getting-started.md index 8dfaa5893..17bdcc534 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -34,7 +34,7 @@ In the root directory of the starter kit, create a `helloworld.html` with the fo