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
Whether to put `connect()` call in the same file as the “dumb” component, or separately, is up to you.
111
113
Ask yourself whether you'd want to reuse this component but bind it to different data, or not.
112
114
113
-
### Usage Notes
115
+
### Nesting
114
116
115
117
You can have many `connect()`-ed components in your app at any depth, and you can even nest them. It is however preferable that you try to only `connect()` top-level components such as route handlers, so the data flow in your application stays predictable.
116
118
@@ -131,7 +133,7 @@ Don’t forget decorators are experimental! And they desugar to function calls a
131
133
132
134
This the most basic usage, but `connect()` supports many other different patterns: just passing the vanilla `dispatch()` function down, binding multiple action creators, putting them as `actions` prop, selecting parts of state and binding action creators depending on `props`, and so on. Check out `connect()` docs below to learn more.
133
135
134
-
### Injecting Redux store
136
+
### Injecting Redux Store
135
137
136
138
Finally, how do we actually hook it up to a Redux store? We need to create the store somewhere at the root of our component hierarchy. For client apps, the root component is a good place. For server rendering, you can do this in the request handler.
0 commit comments