【TypeScript】【React】Could not find a declaration file for module ‘react’

import React from 'react';
Could not find a declaration file for module ‘react’. ‘/Users/username/projects/project-name/node_modules/react/index.js’ implicitly has an ‘any’ type.
If the ‘react’ package actually exposes this module, consider sending a pull request to amend......
“noImplicitAny”: false,

Solution

yarn add -D @types/react
npm install -D @types/react

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store