不确定我缺少什么?但是我确实有两个出口。
如果我删除getFieldDecorator
没有错误,但显然我需要提交此表格。该错误的确切含义是什么?
const FormItem = Form.Item
class Editor extends React.Component {
handleSubmit = event => {
addActivity(event).then(response => {
console.log('post response ' + response)
})
}
render() {
const { getFieldDecorator } = this.props.form
return (
<Form onSubmit={this.handleSubmit}>
<Col span={13} offset={1}>
<label>Comments</label>
<Form.Item>
{getFieldDecorator('Comments', {
rules: [{ required: true }]
})(
<TextArea placeholder="(optional) Comments" rows="4" />
)}
</Form.Item>
</Col>
</Form>
)
}
}
const EditorForm = Form.create()(Editor)
const ConsumerProps= props => (
<SecurityContext.Consumer>
{ctx => <Editor {...props} comsumerId={ctx.comsumerId} />}
</SecurityContext.Consumer>
)
export default (EditorForm, ConsumerProps)