From 62ea0290ed9934b8c6b55ed15f4bbe6f9b6c2b52 Mon Sep 17 00:00:00 2001 From: Mojtaba Dashtinejad Date: Wed, 4 Jan 2017 19:56:33 +0330 Subject: [PATCH] [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 --- docs/reference-react-component.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-react-component.md b/docs/reference-react-component.md index 64a80121..6ca846e2 100644 --- a/docs/reference-react-component.md +++ b/docs/reference-react-component.md @@ -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`. * * *