Example of usage meteor/react-meteor-data with `withRouter` in typescript
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
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.
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<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>'.
- Dominant language
- JavaScript
- Stars
- 576
- Forks
- 168
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 1
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.
More from meteor/react-packages
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 30/100
meteor/react-packages#439 · 6 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
meteor/react-packages#418 · 8 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
meteor/react-packages#413 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
meteor/react-packages#411 · 3 comments ·
-
Dependent execution Opendocumentation enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 28/100
meteor/react-packages#407 · 4 comments ·
All issues in meteor/react-packages
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Add: BuyPass TV Openchannels:add check:passed
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
S: triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·