How to fix error: Attempted import error: 'Route' is not exported from 'react-router-dom'

I was having the same issue. You may have a conflict with NPM and YARN. I deleted my yarn.lock and ran it again with only package.lock; and it worked.

You should only use Yarn or NPM.


Close the server and restart it. It Works Fine.

npm start or yarn start


I was stuck on this as well... For me it worked when the version of "react-router" and "react-router-dom" matched.

"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",