Skip to content

Commit 2883359

Browse files
authored
Merge pull request reactjs#129 from fatosmorina/hyperlink_dry
Hyperlink DRY
2 parents dbfc999 + 728b6f8 commit 2883359

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/docs/thinking-in-react.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ There are two types of "model" data in React: props and state. It's important to
8282

8383
To make your UI interactive, you need to be able to trigger changes to your underlying data model. React makes this easy with **state**.
8484

85-
To build your app correctly, you first need to think of the minimal set of mutable state that your app needs. The key here is DRY: *Don't Repeat Yourself*. Figure out the absolute minimal representation of the state your application needs and compute everything else you need on-demand. For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, simply take the length of the TODO items array.
85+
To build your app correctly, you first need to think of the minimal set of mutable state that your app needs. The key here is [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 you need on-demand. For example, if you're building a TODO list, just keep an array of the TODO items around; don't keep a separate state variable for the count. Instead, when you want to render the TODO count, simply take the length of the TODO items array.
8686

8787
Think of all of the pieces of data in our example application. We have:
8888

0 commit comments

Comments
 (0)