From 9810cc4779a52d2c08f11187d87bfa8d50b8fb0f Mon Sep 17 00:00:00 2001 From: Claudio Brandolino Date: Wed, 15 Jun 2016 08:45:27 +0200 Subject: [PATCH 1/2] Standardise format of the three "state" questions. The original format follows the template: > 1. x? if `x` then probably isn't state > 2. y? if `!y` then probably isn't state > 3. z? if `z` then it's not state This caused both me and a hallway tester to do a double take. The proposed reformulation allows the answers to follow the same template. In the same spirit, it uses the same contraction pattern in the last answer (`it's not state`-> `it isn't state`). This has the welcome side effect to make the lack of "probably" stand out more. --- docs/docs/thinking-in-react.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/thinking-in-react.md b/docs/docs/thinking-in-react.md index 812bbb5e60a1..c14c2a958af6 100644 --- a/docs/docs/thinking-in-react.md +++ b/docs/docs/thinking-in-react.md @@ -93,8 +93,8 @@ Think of all of the pieces of data in our example application. We have: Let's go through each one and figure out which one is state. Simply ask three questions about each piece of data: 1. Is it passed in from a parent via props? If so, it probably isn't state. - 2. Does it change over time? If not, it probably isn't state. - 3. Can you compute it based on any other state or props in your component? If so, it's not state. + 2. Does it remain the same over time? If so, it probably isn't state. + 3. Can you compute it based on any other state or props in your component? If so, it isn't state. The original list of products is passed in as props, so that's not state. The search text and the checkbox seem to be state since they change over time and can't be computed from anything. And finally, the filtered list of products isn't state because it can be computed by combining the original list of products with the search text and value of the checkbox. From ffb1b173fe9f1c353ecdcbb55e4de1225730df62 Mon Sep 17 00:00:00 2001 From: Claudio Brandolino Date: Thu, 16 Jun 2016 14:48:31 +0200 Subject: [PATCH 2/2] Update phrasing in thinking in reacr --- docs/docs/thinking-in-react.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/thinking-in-react.md b/docs/docs/thinking-in-react.md index c14c2a958af6..811bfc9905c8 100644 --- a/docs/docs/thinking-in-react.md +++ b/docs/docs/thinking-in-react.md @@ -93,7 +93,7 @@ Think of all of the pieces of data in our example application. We have: Let's go through each one and figure out which one is state. Simply ask three questions about each piece of data: 1. Is it passed in from a parent via props? If so, it probably isn't state. - 2. Does it remain the same over time? If so, it probably isn't state. + 2. Does it remain unchanged over time? If so, it probably isn't state. 3. Can you compute it based on any other state or props in your component? If so, it isn't state. The original list of products is passed in as props, so that's not state. The search text and the checkbox seem to be state since they change over time and can't be computed from anything. And finally, the filtered list of products isn't state because it can be computed by combining the original list of products with the search text and value of the checkbox.