/Users/[MYUSERNAME]/projects/playground/node_modules/@types/react/index.d.ts
(3554,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'col' must be of type 'DetailedHTMLProps
I get the same error after a fresh install, the error goes away when i delete the rules object in the tsling.json files ... I also didn't find a solution for that one, can any one help, thank you .
I got the same error!
/[MYAPP]/node_modules/@types/react-dom/node_modules/@types/react/index.d.ts
(3631,13): Subsequent property declarations must have the same type. Property 'a' must be of type 'DetailedHTMLProps
node --version
v6.9.2
npm --version
3.10.9
create-react-app --version
1.4.3
react
version: 16.2.0
react-dom
version: 16.2.0
@zmazouzi delete the rules object in the tslint.json not working for me.
EDIT: I've found what I think is the better / correct solution, based on further searching and discovery of this issue and this one.
The problem seems to be conflicting @types versions. To resolve the issue, I updated the dependencies in package.json to require the latest (compatible) versions of @types/react-dom and @types/react-dom
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts-ts": "2.13.0"
},
"devDependencies": {
"@types/jest": "^22.2.0",
"@types/node": "^9.4.6",
"@types/react": "^16.0.40",
"@types/react-dom": "^16.0.4", <--聽(was聽^15.something)
"typescript": "^2.7.2"
}
then deleted the node-modules/@types folder, and re-installed. This seems to more properly resolve the issue. To summarize the solution:
@types dependencies for @types/react-dom in package.json to the latest compatible version (listed here, and here, if you also need to update the react typings, although this was not necessary for me).node_modules/@types foldernpm installnpm run start should just workOLD/ALTERNATE SOLUTION:
I was also getting basically the same error as @wujian-nerc above, and after some googling of the error message (which seems to be very common), found this thread. The suggestion at this particular comment:
Adding React to the paths object in my tsconfig.json file solved the issue for me for now:
{ "compilerOptions": { "typeRoots": [ "node_modules/@types" ], "paths": { "react": ["node_modules/@types/react"] <---Here } }
temporarily does resolve the issue.
@DM-Berger Thanks! It works.
Here is what I have done:
"@types/react-dom": "16.0.4",
Most helpful comment
EDIT: I've found what I think is the better / correct solution, based on further searching and discovery of this issue and this one.
The problem seems to be conflicting
@typesversions. To resolve the issue, I updated the dependencies in package.json to require the latest (compatible) versions of@types/react-domand@types/react-domthen deleted the node-modules/@types folder, and re-installed. This seems to more properly resolve the issue. To summarize the solution:
@typesdependencies for@types/react-dominpackage.jsonto the latest compatible version (listed here, and here, if you also need to update the react typings, although this was not necessary for me).node_modules/@typesfoldernpm installnpm run startshould just workOLD/ALTERNATE SOLUTION:
I was also getting basically the same error as @wujian-nerc above, and after some googling of the error message (which seems to be very common), found this thread. The suggestion at this particular comment:
temporarily does resolve the issue.