You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/FAQ.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,7 @@ Some valid reasons for using multiple stores in Redux might include:
142
142
* Solving a performance issue caused by too frequent updates of some part of the state, when confirmed by profiling the app.
143
143
* Isolating a Redux app as a component in a bigger application, in which case you might want to create a store per root component instance.
144
144
145
-
However, creating new stores shouldn’t be your first instinct, especially if you come from Flux background. Try reducer composition first, and only use multiple stores if it doesn’t solve your problem.
145
+
However, creating new stores shouldn’t be your first instinct, especially if you come from a Flux background. Try reducer composition first, and only use multiple stores if it doesn’t solve your problem.
146
146
147
147
Similarly, while you *can* reference your store instance by importing it directly, this is not a recommended pattern in Redux. If you create a store instance and export it from a module, it will become a singleton. This means it will be harder to isolate a Redux app as a component of a larger app, if this is ever necessary, or to enable server rendering, because on the server you want to create separate store instances for every request.
148
148
@@ -225,7 +225,7 @@ Encapsulating and centralizing commonly used pieces of code is a key concept in
225
225
226
226
### Is there always a one-to-one mapping between reducers and actions?
227
227
228
-
No. We suggest you to write independent small reducer functions that are each responsible for updates to a specific slice of state. We call this pattern “reducer composition”. A given action could be handled by all, some, or none of them. This keep components decoupled from the actual data changes, as one action may affect different parts of the state tree, and there is no need for the component to be aware of this. Some users do choose to bind them more tightly together, such as the “ducks” file structure, but there is definitely no one-to-one mapping by default, and you should break out of such paradigm any time you feel you want to handle an action in many reducers.
228
+
No. We suggest you write independent small reducer functions that are each responsible for updates to a specific slice of state. We call this pattern “reducer composition”. A given action could be handled by all, some, or none of them. This keep components decoupled from the actual data changes, as one action may affect different parts of the state tree, and there is no need for the component to be aware of this. Some users do choose to bind them more tightly together, such as the “ducks” file structure, but there is definitely no one-to-one mapping by default, and you should break out of such a paradigm any time you feel you want to handle an action in many reducers.
229
229
230
230
#### Further information
231
231
@@ -500,7 +500,7 @@ If you do not provide your own `mapDispatchToProps` function when calling `conne
500
500
-[React Redux #89: can i wrap multi actionCreators into one props with name?](https://github.com/reactjs/react-redux/issues/89)
501
501
-[React Redux #145: consider always passing down dispatch regardless of what mapDispatchToProps does](https://github.com/reactjs/react-redux/issues/145)
502
502
-[React Redux #255: this.props.dispatch is undefined if using mapDispatchToProps](https://github.com/reactjs/react-redux/issues/255)
503
-
-[Stack Overflow: http://stackoverflow.com/questions/34458261/how-to-get-simple-dispatch-from-this-props-using-connect-w-redux/34458710](How to get simple dispatch from this.props using connect w/ Redux?)
503
+
-[Stack Overflow: How to get simple dispatch from this.props using connect w/ Redux?](http://stackoverflow.com/questions/34458261/how-to-get-simple-dispatch-from-this-props-using-connect-w-redux/34458710])
504
504
505
505
### Should I only connect my top component, or can I connect multiple components in my tree?
506
506
@@ -519,7 +519,7 @@ In general, try to find a balance between understandable data flow and areas of
519
519
520
520
**Discussions**
521
521
-[Presentational and Container Components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0)
522
-
-[Twitter: emphasizing "one container" was a mistake](https://twitter.com/dan_abramov/status/668585589609005056)
522
+
-[Twitter: emphasizing “one container” was a mistake](https://twitter.com/dan_abramov/status/668585589609005056)
523
523
-[#419: Recommended usage of connect](https://github.com/reactjs/redux/issues/419)
524
524
-[#756: container vs component?](https://github.com/reactjs/redux/issues/756)
525
525
-[#1176: Redux+React with only stateless components](https://github.com/reactjs/redux/issues/1176)
0 commit comments