I see this topic You must pass a component to the function returned by connect. Instead received undefined, but it's does not about my case.
So, I cannot undurstand what is the wrong with my presentation/container connection?
I connect they one to each other, but I get an error: You must pass a component to the function returned by connect. Instead received undefined
/* COMPONENT */
import React from 'react';
import AddTodo from '../../Actions/AddTodo'
import TodoFormAdd from '../../Containers/TodoFormAdd'
class TodoForm extends React.Component{
constructor(props) {
super(props);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit(e) {
e.preventDefault();
document.querySelector('input').input.value = '';
TodoFormAdd(this.props.store, this.input.value);
}
render() {
return (
<form id="tp" onSubmit={this.handleSubmit}>
<input type="text" placeholder="Your text" />
<button type="submit">Add todos</button>
</form>
);
}
}
export default TodoForm;
/* CONTAINER */
import { connect } from 'react-redux';
import TodoForm from '../Components/TodoForm/TodoForm'
import AddTodo from '../Actions/AddTodo'
let TodoFormAdd = (store, input) => store.dispatch(AddTodo(input));
export default connect(TodoFormAdd)(TodoForm);