以下是我的 index.js 文件,我在其中使用了 react-router-dom 进行路由:
import React from 'react';
import ReactDOM from 'react-dom';
import { Route, BrowserRouter as Router } from 'react-router-dom';
import App from './App';
import Users from './Users';
import Submit from './Submit';
import reportWebVitals from './reportWebVitals';
import { Provider } from 'react-redux';
import store from './store';
// Font awesome
import { library } from '@fortawesome/fontawesome-svg-core'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { faCheckSquare, faSort, faAngleDoubleLeft, faAngleDoubleRight } from '@fortawesome/free-solid-svg-icons'
library.add(fab, faCheckSquare, faSort, faAngleDoubleLeft, faAngleDoubleRight);
ReactDOM.render(
<Provider store={store}>
<Router>
<div>
<Route exact path="/" component={App} />
<Route path="/users" component={Users} />
<Route path="/submit" component={Submit} />
</div>
</Router>
</Provider>,
document.getElementById('root')
);
reportWebVitals();
我似乎找不到有关内部服务器错误的问题(我在刷新“/users”页面后发现了该错误)。有人可以告诉我可能是什么问题吗? 提前致谢!