Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs related to UI layers like React-Redux #2591

Closed
markerikson opened this issue Aug 28, 2017 · 5 comments
Closed

Improve docs related to UI layers like React-Redux #2591

markerikson opened this issue Aug 28, 2017 · 5 comments
Labels

Comments

@markerikson
Copy link
Contributor

We've got a section on use with React, but it feels a bit weak to me at the moment. There's several aspects of connect() that aren't covered in there, like the object shorthand form of mapDispatch, using factory functions, and more.

The React-Redux API docs are also kept separate, and live over in the React-Redux repo itself, at https://github.com/reactjs/react-redux/blob/master/docs/api.md . Now, I do fully agree that Redux is UI-layer agnostic, but given that React-Redux is the one "official" set of bindings that we maintain, I'd like to add more detail on how to actually use those correctly into our main docs.

In addition, it would be great if we could add some kind of "Use with other UI libraries" section that gives some details on how to use Redux with Angular, Ember, Vue, Backbone, or jQuery.

@bgates
Copy link

bgates commented Oct 26, 2017

What's the appropriate level to pitch this section (and the rest) of the documentation? I saw your comment in #2295 that Docs are written in a deliberately verbose style for clarity and learning; I spent the last few years at The Iron Yard, sometimes introducing Redux to people who were in their 12th week of learning JavaScript, so I'm biased towards even more verbosity.

What would you think about an expansion of this section, to include

  • motivation for using a state management library with React (what React specifically gains from Redux)
  • what a higher-order component is and why it's the best choice here
  • description of connect as a function returning a function
  • preceding the todo list example with a smaller example of a single container wrapping a presentational component
  • more discussion around mapStateToProps and mapDispatchToProps (more verbose explanations of what the names mean; how they're just names, useful bc they're descriptive, but either could be replaced by pickles if you were consistent and things would still work)
  • some discussion of the "shortcuts and power options", though possibly in a different document?

@markerikson
Copy link
Contributor Author

markerikson commented Oct 26, 2017

@bgates : those are some very interesting questions and ideas. (Also, given your background, I would actually like to pick your brain when you have some time free, and discuss your experience teaching Redux to early learners.)

When I wrote this issue, I was really thinking more in terms of adding additional sections, like a trimmed-down version of the React-Redux API docs, and a section on using Redux with other libraries like Angular or Ember. However, if you have ideas for improving the current Basics: Usage with React page (or any other pages), I'm definitely interested.

@bgates
Copy link

bgates commented Oct 27, 2017

I'd love to talk about early stage education @markerikson - what's a good channel/time?

I'll spend some time this weekend sketching some thoughts out and getting them up as PRs, if that's ok.

@markerikson
Copy link
Contributor Author

I'm returning home from a trip tomorrow. I should probably have time free some evening next week, and Reactiflux is usually the best place to find me.

@codedavinci
Copy link
Contributor

codedavinci commented Jan 2, 2018

Teaching a javascript program for new folks in teach,I also found some challenges in topics like:

  • Explaining short-notation such as connect( state => state.foo, { bar })(myComponent)

  • How connect would implicitly inject the dispatch into props if not functions are passed to second argument of connect (mapDispatchToProps ).

  • Why and How every function in MapDispatchToProps receives the dispatch as an argument.
    And what's the benefit.

  • Why and How MapStateToProps has access to the Store. And What's the benefit.

  • And last but not least, What's connect !!

Just To amend what @bgates said..

markerikson pushed a commit that referenced this issue Sep 2, 2018
It's great to provide links to more in-depth material, but what if we made it seem more optional? It might be better to allow the reader to keep their momentum here.

This is loosely related to #2591.
@timdorr timdorr closed this as completed Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants