mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #5790 from jimfb/componentWillReceiveProps-blogPost
Blog post explains to verify prop mutations in componentWillReceiveProps
(cherry picked from commit a1584053cc)
This commit is contained in:
@@ -148,6 +148,8 @@ componentWillReceiveProps: function(nextProps) {
|
||||
|
||||
> Note:
|
||||
>
|
||||
> One common mistake is for code executed during this lifecycle method to assume that props have changed. To understand why this is invalid, read [A implies B does not imply B implies A](/react/blog/2016/01/08/A-implies-B-does-not-imply-B-implies-A.html)
|
||||
>
|
||||
> There is no analogous method `componentWillReceiveState`. An incoming prop transition may cause a state change, but the opposite is not true. If you need to perform operations in response to a state change, use `componentWillUpdate`.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user