Reputation: 362
I am building a react application using vs2017 , npm and webpack.
I can't get vs to build my solution because of the error described in my title:
Error TS2694 Build:Namespace 'React' has no exported member 'LinkHTMLAttributes'. SpyStore.React C:\Work\Development\React\Spystore\SpyStore.React\SpyStore.React\node_modules\@types\react-router\lib\Link.d.ts 10
Js File : \node_modules\@types\react-router\lib\Link.d.ts
import * as React from 'react';
import Router from './Router';
declare const Link: Link;
type Link = Link.Link;
export default Link;
declare namespace Link {
interface LinkProps extends React.LinkHTMLAttributes<Link> {
activeStyle?: React.CSSProperties;
activeClassName?: string;
onlyActiveOnIndex?: boolean;
to: Router.RoutePattern | Router.LocationDescriptor | ((...args: any[]) => Router.LocationDescriptor);
}
interface Link extends React.ComponentClass<LinkProps> {}
interface LinkElement extends React.ReactElement<LinkProps> {}
}
These are the dependencies and devdependencies inside my package.json:
"dependencies": {
"jquery": "3.1.1",
"react": "15.4.2",
"react-dom": "15.4.2",
"react-router": "3.0.2"
},
"devDependencies": {
"@types/jquery": "1.10.31",
"@types/react": "0.0.0",
"@types/react-router": "^2.0.41",
"typescript": "2.1.6",
"tslint": "4.4.2",
"webpack": "2.2.1",
"webpack-dev-middleware": "1.10.0",
"webpack-dev-server": "2.3.0",
"webpack-md5-hash": "0.0.5",
"webpack-merge": "2.6.1",
"awesome-typescript-loader": "3.0.4-rc.2",
"url-loader": "0.5.7",
"ts-helpers": "1.1.2",
"ts-loader": "2.0.0",
"ts-node": "2.1.0",
"tslint-loader": "3.3.0",
"open-browser-webpack-plugin": "0.0.3",
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.10.0",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"compression-webpack-plugin": "0.3.2",
"copy-webpack-plugin": "4.0.1",
"source-map-loader": "0.1.6"
}
I have tried to delete my node_modules and install them again.
Without success. Any ideas how to solve this?
Upvotes: 1
Views: 1232
Reputation: 362
Well, clearly I didn't search long enough.. Impatient me..
My visual studio didn't show any intellisense on the error, but after some trying I only had to update my react-router to a newer version ;)
Upvotes: 0