VS17 Resharper complains about React.Component

I have included Resharper Ultimate in the .Net Core Web Application, which uses TypeScript for React Components code.

So, I have a simple component class;

export class Index extends React.Component<{},{}>{

Resharper warns me that

Generic type '_$_$RsRpExt"FromFile;....\node_modules\@types\react\index.d.ts, module=JavaScriptReferencedFilesModule:Referenced external files".React.Component' requires 1 type argument(s), but got 2

My npm packages for reaction:

Dependencies:

"react": "^15.6.1",
"react-dom": "^15.6.1",

Dependencies Dev

"@types/react": "^15.0.39",
"@types/react-dom": "^15.5.1",

Looking at the typed files, I see that the React component takes 2 arguments, as follows:

interface Component<P = {}, S = {}> extends ComponentLifecycle<P, S> { }
    class Component<P, S> {
        constructor(props?: P, context?: any);

I use webpack to compile TS / TSX files and everything works and the project works, however it will be annoying if Resharper does not work well with TypeScript code.

Does anyone know how to solve this?

+6
source share
1 answer

Resharper (2017.1) TypeScript 2.2. React , TypeScript 2.3 Resharper 2017.1. Resharper 2017.2 ( EAP) TypeScript 2.4.

Resharper JavaScript/ TypeScript ( Resharper = > Options = > ) VS TypeScript. .

+6

All Articles