react使用typescript时,<Route>组件报错不存在component属性?以及导入时报错Switch也不存在?

新手上路,请多包涵

我创建了一个react-typescript项目,然后通过 yarn add @types/react-router-dom和yarn add react-router-dom安装了路由,然后就给我报这种错??
是没安装正确,还是要单独声明?

阅读 4.5k
2 个回答

看看 @types/react-router-dom 版本

推荐问题