Definitelytyped: @types/react: Subsequent variable declarations must have the same type for 'td'

Created on 23 Aug 2017  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

After updating everything to the latest I get the following issue while compiling my code

image

TypeScript @ 2.4.2
react @ 15.6.1,
types/react @ 16.0.4

Please note that it complains even though the interfaces are identical to the letter.
Downgrading to 16.0.1 works.

Most helpful comment

rm yarn.lock && yarn

Removing the lock file fixed the issue. Probably a mismatch somewhere rather than an error.

All 4 comments

Same issue with @types/[email protected].

rm yarn.lock && yarn

Removing the lock file fixed the issue. Probably a mismatch somewhere rather than an error.

For anyone else's reference, I was banging my head on this issue for a while and my issue was that I was using CRA to bootstrap a nested project (i.e. in an examples folder) and the TS module resolution was finding react both in the new project's node_modules and the parent project's node_modules

I just added skipLibCheck: true on tsconfig.json and worked like a charm.

Was this page helpful?
0 / 5 - 0 ratings