From 28b2b762ab0a01fa448ee6c9c9a59d7190e28582 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 29 Mar 2018 09:13:36 -0700 Subject: [PATCH] Tweaked state-and-lifecycle wording more --- content/docs/state-and-lifecycle.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/docs/state-and-lifecycle.md b/content/docs/state-and-lifecycle.md index 21e91f4b..ff09a803 100644 --- a/content/docs/state-and-lifecycle.md +++ b/content/docs/state-and-lifecycle.md @@ -249,9 +249,7 @@ The `componentDidMount()` hook runs after the component output has been rendered Note how we save the timer ID right on `this`. -While `this.props` is set up by React itself and `this.state` has a special meaning, you are free to add additional fields to the class manually if you need to store something that is not used for the visual output. - -State is generally used to store values that are referenced by `render()` (for visual output) or by `getDerivedStateFromProps()` (to compare next and previous props values). +While `this.props` is set up by React itself and `this.state` has a special meaning, you are free to add additional fields to the class manually if you need to store something that doesn’t participate in the data flow (like a timer ID). We will tear down the timer in the `componentWillUnmount()` lifecycle hook: