请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

正在回答 回答被采纳积分+3

1回答

张轩 2020-04-28 16:25:43

同学你好 

看起来你的 react 的定义文件不知道怎么就丢失了 重新安装一下就好

npm isntall @types/react


0 回复 有任何疑惑可以回复我~
  • 提问者 qq_慕前端6125673 #1
    /Users/dujia/work/MyGit/learn_react/tx-react/src/index.tsx
    TypeScript error in /Users/dujia/work/MyGit/learn_react/tx-react/src/index.tsx(2,22):
    Could not find a declaration file for module 'react-dom'. '/Users/dujia/work/MyGit/learn_react/tx-react/node_modules/react-dom/index.js' implicitly has an 'any' type.
      If the 'react-dom' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom`  TS7016
    
        1 | import React from 'react';
      > 2 | import ReactDOM from 'react-dom';
          |                      ^
        3 | import './index.css';
        4 | import App from './App';
        5 | import * as serviceWorker from './serviceWorker';
    回复 有任何疑惑可以回复我~ 2020-04-28 16:58:18
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信