I'm trying to use React-redux connect with typescript. I'm confused in using the connect with withRouter.
I'm trying to use it like,
withRouter<any>(connect<{},ComponentProps,{}>(
matchStateToProps,
matchDispatchToProps
)(Component));
When trying to pass property productList it throws,
TS2339: Property 'productList' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes, ComponentState>> & Rea...
But in another component,
withRouter<any>(connect<{}, ComponentProps, {}>(
mapStateToProps,
mapDispatchToProps
)(Component));
Does work just fine.
ComponentProps contains all the properties of component. (including stateProps, dispatchProps, RouteProps, & own props).
How to use connect in typescript with react's withRouter? What should I pass as props for withRouter & connect?