Closure and connect argument returning function
Hi,
I have followed described pattern on README page and got to change this
https://github.com/reactjs/reselect#containersvisibletodolistjs-3
const VisibleTodoList = connect(
makeMapStateToProps,
mapDispatchToProps
)(TodoList)
by
const VisibleTodoList = connect(
makeMapStateToProps(),
mapDispatchToProps
)(TodoList)
Any ideas, can it be due to our redux version ?
Thanks,
Julien
I'm afraid the question isn't clear. Can you explain your situation further? What specific problem are you having? What are you trying to do?
I have just been following home page tutorial with the following code
const makeMapStateToProps = () => {
const getVisibleTodos = makeGetVisibleTodos()
const mapStateToProps = (state, props) => {
return {
todos: getVisibleTodos(state, props)
}
}
return mapStateToProps
}
And then add it to connect function as a first parameter
connect(makeMapStateToProps, ....
But it was not working so I replaced it by
connect(makeMapStateToProps(), ....
And it worked.
"react-redux": "4.0.6", "reselect": "2.5.1"
Hmm, I'll take a look.
You need react-redux 4.3 or greater.
Great, thx again, we had to removed our ^dependencies to match version exactly, and I had this bad effect. We will upgrade to last redux version soon.
@darul75 Which error did you get when it "wasn't working"?
Hi sorry I can not remember as it was a long time ago.