From 814bf1ca0caa0fdc0a5a8b9e152886bc2bdd4d3f Mon Sep 17 00:00:00 2001 From: Claudio Brandolino Date: Thu, 16 Jun 2016 19:35:18 +0200 Subject: [PATCH] Standardise format of the three "state" questions. (#7046) * 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. * Update phrasing in thinking in reacr (cherry picked from commit 5bca3773ab8ae385b41b44282f5a5086185b6457) --- 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 812bbb5e60..811bfc9905 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 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.