Switch has been replaced with Routes, take note.


So while watching the material **A practical guide to React 17** While following through the ‘Globomantics’ project' I discovered the instructor imported {Switch} from ‘react-router-dom‘, which does not exist and was throwing an error.

To solve this: just replace Switch with Routes.

Hopefully this helps.


Importing Switch and using Switch in the App function will throw the above error.


So just simply replace ‘Switch’ with ‘Routes’ in both places.

Happy coding.