在Windows8.1上使用VScode在debian 10上使用React进行测试项目,当在项目文件夹中使用命令yarn start时,会出现一个错误:
./src/App.js
Line 6: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 7: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 8: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 9: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 10: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 12: 'React' must be in scope when using JSX react/react-in-jsx-scope使用import React from 'react';或"react/react-in-jsx-scope": "off"的解决方案是行不通的。还有什么问题吗?
发布于 2022-08-29 16:33:52
进口反应从“反应”
这将解决问题。
https://stackoverflow.com/questions/72579962
复制相似问题