首页 > 解决方案 > 刚刚使用 npx 模板创建了新的 reactproject,但项目没有运行

问题描述

TypeScript error in S:/Typerscrip_Project/ts-react-app/src/App.tsx(7,5):
Could not find a declaration file for module 'react/jsx-runtime'. 'S:/Typerscrip_Project/ts-react-app/node_modules/react/jsx-runtime.js' implicitly has an 'any' type.
  If the 'react' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react`  TS7016

     5 | function App() {
     6 |   return (
  >  7 |     <div className="App">
       |     ^
     8 |       <header className="App-header">
     9 |         <img src={logo} className="App-logo" alt="logo" />
    10 |         <p>


标签: typescript

解决方案


推荐阅读