From dfce03c00360f6fcbd59210bad05c576885243a5 Mon Sep 17 00:00:00 2001 From: zqran Date: Sat, 10 Sep 2022 23:59:10 +0800 Subject: [PATCH] [Beta] Update link (#5038) --- beta/src/content/learn/thinking-in-react.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beta/src/content/learn/thinking-in-react.md b/beta/src/content/learn/thinking-in-react.md index cababd394..d039cacfe 100644 --- a/beta/src/content/learn/thinking-in-react.md +++ b/beta/src/content/learn/thinking-in-react.md @@ -209,7 +209,7 @@ At this point, you should not be using any state values. That’s for the next s To make the UI interactive, you need to let users change your underlying data model. You will use *state* for this. -Think of state as the minimal set of changing data that your app needs to remember. The most important principle for structuring state is to keep it [DRY (Don't Repeat Yourself](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)). Figure out the absolute minimal representation of the state your application needs and compute everything else on-demand. For example, if you're building a shopping list, you can store the items as an array in state. If you want to also display the number of items in the list, don't store the number of items as another state value--instead, read the length of your array. +Think of state as the minimal set of changing data that your app needs to remember. The most important principle for structuring state is to keep it [DRY (Don't Repeat Yourself).](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) Figure out the absolute minimal representation of the state your application needs and compute everything else on-demand. For example, if you're building a shopping list, you can store the items as an array in state. If you want to also display the number of items in the list, don't store the number of items as another state value--instead, read the length of your array. Now think of all of the pieces of data in this example application: