meteor / meteor/react-packages
Example of usage meteor/react-meteor-data with `withRouter` in typescript
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 575
- Forks
- 168
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 1
Description
I am using this package with typescript
https://packosphere.com/meteor/react-meteor-data
My code
```
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 {
title: string;
}
class MyComp extends React.Component {
public render(): JSX.Element {
return
{this.props.title}
;}
}
export default withRouter(
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>'.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the TypeScript error at the meteor/react-meteor-data entry point with the shown withRouter and withTracker composition. No repository files or tests are named, so locate the package typings and existing TypeScript coverage before defining the fix. Done means the example composes without TS2345 and its intended prop types remain valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100