【发布时间】:2017-11-05 17:46:38
【问题描述】:
我正在使用 redux 表单构建一个表单,并且我正在使用 react-bootstrap for ui 框架。但我无法让 redux 表单与 react-bootstrap 选择组件一起使用。显示选择字段,但不呈现选项并且它们不可见。任何帮助将不胜感激。
这是我目前所拥有的:
form.js:
render() {
<Form horizontal onSubmit={handleSubmit}>
<Field component={SelectField} label='Gender' name='gender'>
<option value='male'>Male</option>
<option value='female'>Female</option>
</Field>
</Form>
}
selectField.js:
props => {
return (
<FormGroup>
<Col componentClass={ControlLabel} sm={2}>
{props.label}
</Col>
<Col sm={4}>
<FormControl componentClass='select' placeholder='select'
{...props.input}>
</FormControl>
</Col>
</FormGroup>
);
}
【问题讨论】:
标签: reactjs react-redux redux-form react-bootstrap