Reputation: 746
my component has some own props
class Props {
wizard: WizardConfig;
}
and I want to access router history so I also pass router props
type PropsType = Props & RouteComponentProps<{}>;
class Wizard extends React.Component<PropsType> {}
The problem is that in component's usage
<Wizard wizard={someWizar} />
I get errors that RouteComponentProps
props are not passed so for example:
Property 'match' is missing in type '{ wizard: WizardConfig; }'
I tried to do:
export default withRouter(Wizard);
but it didn't help.
Upvotes: 1
Views: 1637
Reputation: 746
Fixed by changing
export default withRouter(Wizard);
to
export default withRouter<PropsType>(Wizard);
Upvotes: 3