mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-26 07:14:59 +00:00
clarify SRP definition (#8008)
* clarify SRP definition * Update src/content/learn/thinking-in-react.md --------- Co-authored-by: Ricky <rickhanlonii@gmail.com>
This commit is contained in:
@@ -37,7 +37,7 @@ Start by drawing boxes around every component and subcomponent in the mockup and
|
||||
|
||||
Depending on your background, you can think about splitting up a design into components in different ways:
|
||||
|
||||
* **Programming**--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.
|
||||
* **Programming**--use the same techniques for deciding if you should create a new function or object. One such technique is the [separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns), that is, a component should ideally only be concerned with one thing. If it ends up growing, it should be decomposed into smaller subcomponents.
|
||||
* **CSS**--consider what you would make class selectors for. (However, components are a bit less granular.)
|
||||
* **Design**--consider how you would organize the design's layers.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user