How to test a React component with RouteComponentProps?
问题 I have a component that has props which extend RouteComponentProps that looks like this: export interface RouteComponentProps<P> { match: match<P>; location: H.Location; history: H.History; staticContext?: any; } Now, when I use my component in the app, I pass these props to it: <MyComponent match={this.props.match} location={this.props.location} history={this.props.history} /> The props are available already because it's running inside react router. Now, how do I test this component without