redux - material-ui withStyle 不适用于 resux-form
问题描述
我目前正在开发我的第一个真正的 React-Redux 应用程序(准确地说是 ReactDom)。该应用程序正在使用材质 ui(我不是项目经理)
我无法将样式应用于通过 reduxForm 导出的组件。我的代码:
import React, {Component} from 'react';
import {withStyles} from '@material-ui/core/styles/withStyles';
import { TextField } from '@material-ui/core';
import { Field, reduxForm} from 'redux-form';
import {connect} from 'react-redux';
import { some acttions } from '../actions';
const styles = (theme) => ({});
const mapStateToProps = (state) => ({});
const mapDispatchToProps = (dispatch) => ({
some: () => dispatch(some(data)),
actions: () => dispatch(actions())
})
class FormComponent extends Component {
// Component with form
}
FormComponent = connect(
mapStateToProps,
mapDispatchToProps
)(withStyles(styles)(FormComponent));
export default reduxForm({
form: 'myForm'
})(FormComponent);
这导致TypeError: Object(...) is not a function
指向带有连接的命令。当我用Style擦除时,它不会损坏,但看起来很糟糕。
提前致谢, 加尔
解决方案
推荐阅读
- split - 无法在拆分块中解析复制
- qt - QQuickWidget 无法推广
- r - 使用具有浮动顶部和底部值的剪切序列进行分组
- python - 如何从 Pandas 的数据框中选择匹配结果?
- java - 如何使用弹簧注释重新编号表的主索引?
- html - 为 HTML div 应用引导网格样式
- c# - 在 Newtonsoft 中使用 JsonProperty 自动修复命名规则违规
- powerbi - 计算同一行中的数字之间的差异 - 不同的列
- c# - 如果行/行不是以 c# 中已建立的字符开头,则跳过或删除 CSV 文件中的行/行
- devstack - 使用终端创建图像时,Devstack 中的 auth 插件密码缺少值 auth-url