Browse Source

[Beta] Update link (#5038)

main
zqran 2 years ago
committed by GitHub
parent
commit
dfce03c003
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/content/learn/thinking-in-react.md

2
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:

Loading…
Cancel
Save