I cannot use "Switch" or "Routes" with react router (specifically react-router-dom). Because there seems to be a bit of confusion about which one to use, Switch or Routes, I decided to try both to get try to get somewhere.
I am using react-router-dom version :
"react-router-dom": "^6.2.1",
If I import like this :
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom'
compiler says that Cannot resolve symbol 'Routes'
If I instead import Switch like this :
import { BrowserRouter as Router, Route, Switch} from 'react-router-dom'
then I get this error export 'Switch' (imported as 'Switch') was not found in 'react-router-dom'
Is this some bug in the version?
********** UPDATE ***********
I have rolled back to React Router/Dom version 5.2.0.
Version 6.x seems too broken.
For example in the @type module installing version 6.x installs the wrong types.
"name": "@types/react-router",
"version": "5.1.17",
This is wrong and confuses my IDE.