score:0

import { withRouter, RouteComponentProps } from "react-router-dom";
import { connect, ConnectedProps } from "react-redux";
import { RootState } from "../reducers/rootReducer"; // your custom file

const mapStateToProps = (state: RootState) => {return {...}}; // RootState is your main state from Redux
const mapDispatchToProps = (dispatch) => {return{...}};

const connector = connect(mapStateToProps, mapDispatchToProps);
type PropsFromRedux = ConnectedProps<typeof connector>;

type MyProps = PropsFromRedux & RouteComponentProps & {...}; // Custom props goes here

class YourReactClassComponent extends Component<MyProps, MyState> {...}

export default withRouter(connector(YourReactClassComponent));

Related Query

More Query from same tag