我的组件有一些自己的props
class Props {
wizard: WizardConfig;
}
我想访问路由器历史记录所以我也通过路由器props
type PropsType = Props & RouteComponentProps<{}>;
class Wizard extends React.Component<PropsType> {}
问题是在组件的使用中
<Wizard wizard={someWizar} />
我收到RouteComponentProps未通过props的错误,例如:
Property 'match' is missing in type '{ wizard: WizardConfig; }'
我试图做:
export default withRouter(Wizard);
但它没有帮助。