Attempted import error: 'BrowseRouter' is not exported from 'react-router-dom' (imported as 'Router')

Attempted import error: 'BrowseRouter' is not exported from 'react-router-dom' (imported as 'Router')

我不知道为什么会收到此错误,我已尝试在线搜索并看到了一些我尝试过的建议,但错误无法清除。请有人知道我做错了什么。 这是我的代码:

import React from 'react';

import { BrowseRouter as Router, Route } from 'react-router-dom';

import Join from './components/Join';
import Chat from './components/Chat';

const App = () => (
    <Router>
        <Route path="/" exact component={Join} />
        <Route path="/chat" exact component={Chat} />
    </Router>
);

export default App;

react-router-dom 不导出 BrowseRouter,它导出 BrowserRouter

Documentation here

BrowserRouter 拼写错误** 您将其命名为 BrowseRouter。 它应该是 BrowserRouter 而不是 BrowseRouter。 试试这个

从“react-router-dom”导入 { BrowserRouter 作为路由器};