【发布时间】:2020-03-04 05:16:00
【问题描述】:
当我尝试使用使用material-ui withStyles 功能导出的组件时,我收到了这个警告,如下所示:
export default withStyles(styles)(MyComponent)
然后像这样将它传递给ReactRouter:
import MyComponentfrom './MyComponent'
<Route path="/my-component" component={MyComponent} />
组件正在按预期呈现并且运行良好,但警告让我感到困扰。
谁能解释我为什么会得到这个?
【问题讨论】:
-
你能添加警告吗
-
你用的是什么版本的 react-router?
-
这可能与stackoverflow.com/questions/56448807/… 类似的问题,除了使用旧版本的 react-router 而不是旧版本的 react-redux。
标签: reactjs react-router material-ui