TS2503
error TS2503: Cannot find namespace ‘
React
‘.
Broken Code ❌
1 |
|
Fixed Code ✔️
You have to add an import statement when reusing a different namespace. Also make sure to install type declarations (i.e. @types/react
) if needed.
1 |
|
error TS2503: Cannot find name ‘process’. Do you need to install type definitions for node? Try
npm i --save-dev @types/node
.
Solution
Run yarn add --dev @types/node
in your npm project.