Skip to content

Commit 133e38c

Browse files
mfeniseycopestimdorr
authored andcommitted
Make Provider not need to wrap root component (#674)
Provider only needs to wrap an ancestor component to pass store to `connect`. Also, made the `connectAdvanced` remarks more explicit (the "it"s were very vague sounding).
1 parent 85145c2 commit 133e38c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<a id="provider"></a>
44
### `<Provider store>`
55

6-
Makes the Redux store available to the `connect()` calls in the component hierarchy below. Normally, you can’t use `connect()` without wrapping the root component in `<Provider>`.
6+
Makes the Redux store available to the `connect()` calls in the component hierarchy below. Normally, you can’t use `connect()` without wrapping a parent or ancestor component in `<Provider>`.
77

88
If you *really* need to, you can manually pass `store` as a prop to every `connect()`ed component, but we only recommend to do this for stubbing `store` in unit tests, or in non-fully-React codebases. Normally, you should just use `<Provider>`.
99

@@ -348,9 +348,9 @@ Returns the wrapped component instance. Only available if you pass `{ withRef: t
348348

349349
#### Remarks
350350

351-
* Since it returns a higher-order component, it needs to be invoked two times. The first time with its arguments as described above, and a second time, with the component: `connectAdvanced(selectorFactory)(MyComponent)`.
351+
* Since `connectAdvanced` returns a higher-order component, it needs to be invoked two times. The first time with its arguments as described above, and a second time, with the component: `connectAdvanced(selectorFactory)(MyComponent)`.
352352

353-
* It does not modify the passed React component. It returns a new, connected component, that you should use instead.
353+
* `connectAdvanced` does not modify the passed React component. It returns a new, connected component, that you should use instead.
354354

355355
<a id="connectAdvanced-examples"></a>
356356
#### Examples

0 commit comments

Comments
 (0)