Inferring mapped props when using TypeScript and React-Redux
问题 I found a way to get type safety when using mapStateToProps from react-redux : as documented you can define an interface and parameterize React.Component<T> with your interface. However, when I am defining mapStateToProps , I'm already defining a function where the types of the properties of the resulting object can be inferred. Eg, function mapStateToProps(state: MyState) { return { counter: state.counter }; } Here, the prop counter can be inferred to be the same type as state.counter . But