Skip to content

Commit b3ec51f

Browse files
author
Misha Moroshko
committed
Fix connect() call and missing React imports
1 parent 31fc2ee commit b3ec51f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/Troubleshooting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function addTodo(text) {
126126
#### `AddTodo.js`
127127

128128
```js
129-
import { Component } from 'react';
129+
import React, { Component } from 'react';
130130
import { addTodo } from './TodoActions';
131131

132132
class AddTodo extends Component {
@@ -161,7 +161,7 @@ If you’re somewhere deep in the component hierarchy, it is cumbersome to pass
161161
The fixed code looks like this:
162162
#### `AddTodo.js`
163163
```js
164-
import { Component } from 'react';
164+
import React, { Component } from 'react';
165165
import { connect } from 'react-redux';
166166
import { addTodo } from './TodoActions';
167167

@@ -181,7 +181,7 @@ class AddTodo extends Component {
181181
}
182182

183183
// In addition to the state, `connect` puts `dispatch` in our props.
184-
export default connect(AddTodo, state => ({}))
184+
export default connect()(AddTodo);
185185
```
186186

187187
You can then pass `dispatch` down to other components manually, if you want to.

0 commit comments

Comments
 (0)