Skip to content

Commit

Permalink
Update thinking-in-react.md (#2098)
Browse files Browse the repository at this point in the history
Follow up to #2095 (comment)
  • Loading branch information
EmmaB authored and sophiebits committed Jun 24, 2019
1 parent 92ad9c2 commit 39f30d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/thinking-in-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The first thing you'll want to do is to draw boxes around every component (and s

But how do you know what should be its own component? Use the same techniques for deciding if you should create a new function or object. One such technique is the [single responsibility principle](https://en.wikipedia.org/wiki/Single_responsibility_principle), that is, a component should ideally only do one thing. If it ends up growing, it should be decomposed into smaller subcomponents.

Since you're often displaying a JSON data model to a user, you'll find that if your model was built correctly, your UI (and therefore your component structure) will map nicely. That's because UI and data models tend to adhere to the same *information architecture*, which means the work of separating your UI into components is often trivial. Break it up into components that represent exactly one piece of your data model.
Since you're often displaying a JSON data model to a user, you'll find that if your model was built correctly, your UI (and therefore your component structure) will map nicely. That's because UI and data models tend to adhere to the same *information architecture*. Separate your UI into components, where each component matches one piece of your data model.

![Component diagram](../images/blog/thinking-in-react-components.png)

Expand Down

0 comments on commit 39f30d4

Please sign in to comment.