Caution (in docs) against dispatching redux actions or triggering component updates by any other means in componentWillUpdate

This commit is contained in:
Andy Edwards
2017-10-08 15:28:18 -05:00
committed by GitHub
parent be1f9a60d8
commit e97ad4f5d4

View File

@@ -216,7 +216,7 @@ componentWillUpdate(nextProps, nextState)
`componentWillUpdate()` is invoked immediately before rendering when new props or state are being received. Use this as an opportunity to perform preparation before an update occurs. This method is not called for the initial render.
Note that you cannot call `this.setState()` here. If you need to update state in response to a prop change, use `componentWillReceiveProps()` instead.
Note that you cannot call `this.setState()` here; nor should you do anything else (for example, dispatching redux actions) that would trigger an update to any React component before `componentWillUpdate` returns. If you need to update state in response to a prop change, use `componentWillReceiveProps()` instead.
> Note
>