React-redux: Example of TodoApp?

Created on 21 Aug 2016  路  4Comments  路  Source: reduxjs/react-redux

What's that? How does TodoApp look? Is it just a function as everywhere in you your example here http://redux.js.org/docs/basics/ExampleTodoList.html, or should it be a full-featured React component? If one follows your examples and uses functions, there is no dispatch within the TodoApp function. It only injects todos, not dispatch. Why do you say that it injects dispatch then? Please be more detailed writing the documentation. Provide TodoApp example. Now it is not possible to understand.

react-redux_api md at master reactjs_react-redux - google chrome 2016-08-21 12 57 10

help wanted

Most helpful comment

Please note that dispatch accepts two main arguments, mapStateToProps and mapDispatchToProps. If a mapDispatch argument is not provided, connect will provide its own, which by default will inject the dispatch reference. So, in that example, the provided mapState will inject a todos prop, and the default mapDispatch will inject a dispatch prop.

All 4 comments

That's fair. I can see that being hard to understand if you haven't been following along with the Redux documentation. Want to submit a PR to clear it up?

Please note that dispatch accepts two main arguments, mapStateToProps and mapDispatchToProps. If a mapDispatch argument is not provided, connect will provide its own, which by default will inject the dispatch reference. So, in that example, the provided mapState will inject a todos prop, and the default mapDispatch will inject a dispatch prop.

I can help out with this if nobody has dibs. Wouldn't the PR have to go to "redux" repo proper for this file: https://github.com/reactjs/redux/blob/master/docs/basics/ExampleTodoList.md ? @markerikson @timdorr

Thanks guys!

More I look at this, I am not sure if this issue is in the docs currently as of Dec 2016. Might be already solved issue.

Was this page helpful?
0 / 5 - 0 ratings