From 43128ce23380620e184a8b9c38e0c364c311c03e Mon Sep 17 00:00:00 2001 From: jim Date: Wed, 2 Dec 2015 19:21:55 -0800 Subject: [PATCH] Increase severity of setprops and replaceprops deprecations, since their removal is now imminent. --- docs/ref-02-component-api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ref-02-component-api.md b/docs/ref-02-component-api.md index 919e2022..68809cae 100644 --- a/docs/ref-02-component-api.md +++ b/docs/ref-02-component-api.md @@ -124,11 +124,11 @@ Calling `setProps()` on a root-level component will change its properties and tr > Note: > +> This method is deprecated and will be removed soon. This method is not available on ES6 `class` components that extend `React.Component`. Instead of calling `setProps`, try invoking ReactDOM.render() again with the new props. For additional notes, see our [blog post about using the Top Level API](/react/blog/2015/10/01/react-render-and-top-level-api.html) +> > When possible, the declarative approach of calling `ReactDOM.render()` again on the same node is preferred instead. It tends to make updates easier to reason about. (There's no significant performance difference between the two approaches.) > > This method can only be called on a root-level component. That is, it's only available on the component passed directly to `ReactDOM.render()` and none of its children. If you're inclined to use `setProps()` on a child component, instead take advantage of reactive updates and pass the new prop to the child component when it's created in `render()`. -> -> This method is not available on ES6 `class` components that extend `React.Component`. It may be removed entirely in a future version of React. ### replaceProps @@ -143,4 +143,4 @@ Like `setProps()` but deletes any pre-existing props instead of merging the two > Note: > -> This method is not available on ES6 `class` components that extend `React.Component`. It may be removed entirely in a future version of React. +> This method is deprecated and will be removed soon. This method is not available on ES6 `class` components that extend `React.Component`. Instead of calling `replaceProps`, try invoking ReactDOM.render() again with the new props. For additional notes, see our [blog post about using the Top Level API](/react/blog/2015/10/01/react-render-and-top-level-api.html) \ No newline at end of file