ccurves
ccurves

Reputation: 1001

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

I dont know why i am getting this error, i have tried searching online and i saw some suggestions which i tried out but the error wouldn't clear. Please does anyone have any idea on what am doing wrong. Here is my code:

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;

Upvotes: 4

Views: 11579

Answers (2)

Rayan ramirez
Rayan ramirez

Reputation: 31

there is a misspelled on BrowserRouter** you have it as BrowseRouter. it should be BrowserRouter not BrowseRouter. try this

import { BrowserRouter as Router } from "react-router-dom";

Upvotes: 3

coreyward
coreyward

Reputation: 80128

react-router-dom doesn’t export BrowseRouter, it exports BrowserRouter.

Documentation here

Upvotes: 10

Related Questions