Even though I used Routes instead of switch still its showing the same error ,I installed react dom using the command npm install -S react-router-dom. The code is below
import './App.css';
import Header from './Header';
import Home from './Home';
import {BrowserRouter as Router,Switch,Route} from 'react-router-dom';
function App() {
return (
> <Router>
> <div className='app'>
> <Switch>
> <Route path='/'>
> <Header/>
> <Home/>
> </Route>
> </Switch>
> </div>
> </Router>
export default App;
The Error that is showing is 'Switch' (imported as 'Switch') was not found in 'react-router-dom' And 'Route' (imported as 'Route') was not found in 'react-router-dom'