mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[docs] Add a note about componentWillReceiveProps (#8234)
* Component Lifecycle In Depth documentation * first steps to improve react component reference * improved react component reference - remove the component-lifecycle-in-depth * add a note for usage of ReactDOM.findDOMNode * one note on componentWillReceiveProps * remove old useless images for lifecycle docs * Tweak wording
This commit is contained in:
committed by
Dan Abramov
parent
8403a3e6a4
commit
9b6cecd2cb
@@ -163,7 +163,7 @@ componentWillReceiveProps(nextProps)
|
||||
|
||||
Note that React may call this method even if the props have not changed, so make sure to compare the current and next values if you only want to handle changes. This may occur when the parent component causes your component to re-render.
|
||||
|
||||
`componentWillReceiveProps()` is not invoked if you just call `this.setState()`
|
||||
React doesn't call `componentWillReceiveProps` with initial props during [mounting](#mounting). It only calls this method if some of component's props may update. Calling `this.setState` generally doesn't trigger `componentWillReceiveProps`.
|
||||
|
||||
* * *
|
||||
|
||||
|
||||
Reference in New Issue
Block a user