[react-redux] MapStateToProps and MapDispatchToProps missing alternate types
See original GitHub issueReact Redux allows MapStateToProps to be:
- a function that returns:
- an object
- a function that itself returns an object
and allows MapDispatchToProps to be:
- an object
- a function that returns:
- an object
- a function that itself returns an object
The previous version of the libdef, flow_v0.54.x-v0.61.x/react-redux_v5.x.x.js
, included each of these types (with the exception of MapDispatchToProps’ function that returns a function that returns an object). In the current version, flow_v0.62.0-/react-redux_v5.x.x.js
, both MapStateToProps and MapDispatchToProps include only:
- a function that returns:
- an object
Was there a reason for the alternate types’ omission?
Also, shouldn’t props/ownProps be declared optional?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (7 by maintainers)
Top Results From Across the Web
MapDispatchToProps causes Typescript Error in parent ...
Now in my parent component Typescript is telling me that it is missing the properties that I defined in PropsFromDispatch. This doesn't seem ......
Read more >Connect | React Redux
The mapStateToProps and mapDispatchToProps deals with your Redux store's state ... connect accepts four different parameters, all optional.
Read more >react-redux: type error for connect inside HOC #31363 - GitHub
I tried using the @types/react-redux package and had problems. ... connect( mapStateToProps, mapDispatchToProps )(Counter); const ...
Read more >Typescript Tips Series: Proper Typing of react-redux ... - Medium
The StateProps and DispatchProps types are nice to have, as they help to catch errors in the mapStateToProps and mapDispatchToProps methods at ...
Read more >3 ways to test mapStateToProps and mapDispatchToProps
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; // Component 1 - "Base component" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gantoine please can you fix the tags on this issue?
Responding on the PR… 😃