Skip to content

Commit 7ab1acb

Browse files
committed
Merge pull request #1037 from camsong/master
Rename smart/dumb to presentational/container
2 parents 2341b3f + d25a40c commit 7ab1acb

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

docs/advanced/ExampleRedditAPI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export default function configureStore(initialState) {
180180
}
181181
```
182182

183-
## Smart Components
183+
## Container Components
184184

185185
#### `containers/Root.js`
186186

@@ -310,7 +310,7 @@ function mapStateToProps(state) {
310310
export default connect(mapStateToProps)(AsyncApp)
311311
```
312312

313-
## Dumb Components
313+
## Presentational Components
314314

315315
#### `components/Picker.js`
316316

docs/basics/ExampleTodoList.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const todoApp = combineReducers({
114114
export default todoApp
115115
```
116116

117-
## Smart Components
117+
## Container Components
118118

119119
#### `containers/App.js`
120120

@@ -187,7 +187,7 @@ function select(state) {
187187
export default connect(select)(App)
188188
```
189189

190-
## Dumb Components
190+
## Presentational Components
191191

192192
#### `components/AddTodo.js`
193193

docs/basics/UsageWithReact.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ We will use React to build our simple todo app.
1414
npm install --save react-redux
1515
```
1616

17-
## Smart and Dumb Components
17+
## Container and Presentational Components
1818

19-
React bindings for Redux embrace the idea of [separating “smart” and “dumb” components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0).
19+
React bindings for Redux embrace the idea of [separating container and presentational components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0).
2020

21-
It is advisable that only top-level components of your app (such as route handlers) are aware of Redux. Components below them should be “dumb” and receive all data via props.
21+
It is advisable that only top-level components of your app (such as route handlers) are aware of Redux. Components below them should be presentational and receive all data via props.
2222

2323
<table>
2424
<thead>
2525
<tr>
2626
<th></th>
27-
<th scope="col" style="text-align:left">“Smart” Components</th>
28-
<th scope="col" style="text-align:left">“Dumb” Components</th>
27+
<th scope="col" style="text-align:left">Container Components</th>
28+
<th scope="col" style="text-align:left">Presentational Components</th>
2929
</tr>
3030
</thead>
3131
<tbody>
@@ -52,7 +52,7 @@ It is advisable that only top-level components of your app (such as route handle
5252
</tbody>
5353
</table>
5454

55-
In this todo app, we will only have a single “smart” component at the top of our view hierarchy. In more complex apps, you might have several of them. While you may nest “smart” components, we suggest that you pass props down whenever possible.
55+
In this todo app, we will only have a single container component at the top of our view hierarchy. In more complex apps, you might have several of them. While you may nest container components, we suggest that you pass props down whenever possible.
5656

5757
## Designing Component Hierarchy
5858

@@ -75,13 +75,13 @@ I see the following components (and their props) emerge from this brief:
7575
- `filter: string` is the current filter: `'SHOW_ALL'`, `'SHOW_COMPLETED'` or `'SHOW_ACTIVE'`.
7676
- `onFilterChange(nextFilter: string)`: Callback to invoke when user chooses a different filter.
7777

78-
These are all “dumb” components. They don’t know *where* the data comes from, or *how* to change it. They only render what’s given to them.
78+
These are all presentational components. They don’t know *where* the data comes from, or *how* to change it. They only render what’s given to them.
7979

8080
If you migrate from Redux to something else, you’ll be able to keep all these components exactly the same. They have no dependency on Redux.
8181

8282
Let’s write them! We don’t need to think about binding to Redux yet. You can just give them fake data while you experiment until they render correctly.
8383

84-
## Dumb Components
84+
## Presentational Components
8585

8686
These are all normal React components, so we won’t stop to examine them in detail. Here they go:
8787

docs/recipes/ReducingBoilerplate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export default connect(state => ({
323323
}))(Posts)
324324
```
325325

326-
This is much less typing! If you’d like, you can still have “vanilla” action creators like `loadPostsSuccess` which you’d use from a “smart” `loadPosts` action creator.
326+
This is much less typing! If you’d like, you can still have “vanilla” action creators like `loadPostsSuccess` which you’d use from a container `loadPosts` action creator.
327327

328328
**Finally, you can write your own middleware.** Let’s say you want to generalize the pattern above and describe your async action creators like this instead:
329329

0 commit comments

Comments
 (0)