Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
这里的react-router-dom要注意是5的版本才可以用switch 6版本的route和5的route用法也不太一样 可以在package.json里面查看版本