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

Feature: add object shorthand for mapStateToProps in connect #1566

Conversation

GregoryNative
Copy link

I found it useful for myself.

Same as we use shorthand for mapDispatchToProps in connect, it's also possible to do for mapStateToProps using reselect library. It's good 1 file library, and even mentioned in redux here:
https://redux.js.org/recipes/computing-derived-data#selectorsindexjs

@netlify
Copy link

netlify bot commented Apr 13, 2020

Deploy preview for react-redux-docs ready!

Built with commit a0630c8

https://deploy-preview-1566--react-redux-docs.netlify.com

@markerikson
Copy link
Contributor

Hi. Appreciate the PR. This was previously attempted in #323 , #723 , and #724 . Ultimately, we decided that there was too much complexity in how this could work, and that it was not a feature we wanted to add.

We will continue to maintain connect in general, but at this point we're recommending that folks use the hooks API as the default approach, so I don't see a need to add more features to connect.

In addition, our implementation has avoided any additional external dependencies like reselect, and we're not going to add another dependency for a rarely-used feature.

@GregoryNative
Copy link
Author

Np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants