import React from 'react';
// import {withRouter} from 'react-router-dom';
import {withTracker} from 'meteor/react-meteor-data';
import {RouteComponentProps, withRouter} from 'react-router-dom';
interface IProps extends RouteComponentProps<any> {
title: string;
}
class MyComp extends React.Component<IProps> {
public render(): JSX.Element {
return <h1>{this.props.title}</h1>;
}
}
export default withRouter<IProps, typeof MyComp>(
withTracker(() => {
return {title: 'ok'};
})(MyComp)
);
Error:
Description
TS2345: Argument of type 'ComponentClass<unknown, any>' is not assignable to parameter of type 'typeof MyComp & ComponentType<IProps>'. Type 'ComponentClass<unknown, any>' is not assignable to type 'typeof MyComp & ComponentClass<IProps, any>'. Type 'ComponentClass<unknown, any>' is not assignable to type 'typeof MyComp'. Construct signature return types 'Component<unknown, any, any>' and 'MyComp' are incompatible. The types returned by 'render()' are incompatible between these types. Type 'ReactNode' is not assignable to type 'Element'. Type 'undefined' is not assignable to type 'ReactElement<any, any>'.
I am using this package with typescript
https://packosphere.com/meteor/react-meteor-data
My code
Error:
Description