错误来自我的App.js文件的第一行。当我尝试导入react时,第一行出现错误。我已经确保安装了所有依赖项,并且重新启动了vs代码。
未捕获语法错误c:\Users\Dell i7\react-category-v1\src\App.js:1从“React”导入React
import React from 'react'
import { connect } from 'react-redux'
import './App.css';
import Navbar from './components/Navbar';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Home from './pages/Home';
import Reports from './pages/Reports';
import Products from './pages/Products';
function App() {
return (
<>
<Router>
<Navbar />
<Switch>
<Route path='/' exact component={Home} />
</Switch>
</Router>
</>
);
}
export default App;
1条答案
按热度按时间9lowa7mx1#
使用路由器代替交换机,我认为交换机不再可用