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: README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ export default connect(
130
130
```
131
131
132
132
Whether to put the `connect()` call in the same file as the “dumb” component, or separately, is up to you.
133
-
Ask yourself whether you'd want to reuse this component but bind it to different data, or not.
133
+
Ask yourself whether you’d want to reuse this component but bind it to different data, or not.
134
134
135
135
### Nesting
136
136
@@ -463,11 +463,11 @@ render() {
463
463
Conveniently, this gives your components access to the router state!
464
464
You can also upgrade to React Router 1.0 which shouldn’t have this problem. (Let us know if it does!)
465
465
466
-
### My views aren't updating when something changes outside of Redux
466
+
### My views aren’t updating when something changes outside of Redux
467
467
468
468
If your views depend on global state or [React “context”](www.youtube.com/watch?v=H7vlH-wntD4), you might find that views decorated with `connect()` will fail to update.
469
469
470
-
>This is because `connect()` implements [shouldComponentUpdate](https://facebook.github.io/react/docs/component-specs.html#updating-shouldcomponentupdate) by default, assuming that your component will produce the same results given the same props and state. This is a similar concept to React's [PureRenderMixin](https://facebook.github.io/react/docs/pure-render-mixin.html).
470
+
>This is because `connect()` implements [shouldComponentUpdate](https://facebook.github.io/react/docs/component-specs.html#updating-shouldcomponentupdate) by default, assuming that your component will produce the same results given the same props and state. This is a similar concept to React’s [PureRenderMixin](https://facebook.github.io/react/docs/pure-render-mixin.html).
471
471
472
472
The _best_ solution to this is to make sure that your components are pure and pass any external state to them via props. This will ensure that your views do not re-render unless they actually need to re-render and will greatly speed up your application.
473
473
@@ -493,7 +493,7 @@ If you have context issues,
493
493
2. Make sure you didn’t forget to wrap your root component in [`<Provider>`](#provider-store).
494
494
3. If you use React Router, something like `<Provider>{() => router}</Provider>` won’t work. Due to the way context works in React 0.13, it’s important that the `<Provider>` children are *created* inside that function. Just referencing an outside variable doesn’t do the trick. Instead of `<Provider>{() => router}</Provider>`, write `<Provider>{() => createRouter()}</Provider>` where `createRouter()` is a function that actually *creates* (and returns) the router.
495
495
496
-
### Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner
496
+
### Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you’re trying to add a ref to a component that doesn’t have an owner
497
497
498
498
If you’re using React for web, this usually means you have a [duplicate React](https://medium.com/@dan_abramov/two-weird-tricks-that-fix-react-7cf9bbdef375). Follow the linked instructions to fix this.
0 commit comments