从 v3.9.x 升级到 MUI v4.0.2 后,我收到以下错误:
您必须将一个组件传递给 connect 返回的函数。而是收到 {"propTypes":{},"displayName":"WithStyles(MyComponent)","options":{"defaultTheme":{"breakpoints":{"keys":["xs","sm"," md","lg","xl"],"values": ...
我的组件:
import { withStyles } from '@material-ui/core/styles'
const getStyles = theme => ({
fooBar: {
...
},
})
...
export default withStyles(getStyles)(MyComponent)
我的容器:
import { connect } from 'react-redux'
import MyComponent from './MyComponent'
...
export default connect(mapStateToProps, mapDispatchToProps)(MyComponent)
如何迁移withStyles
?