对于我的react项目,我正在使用reactstrap设置表单样式,但是我想将其转换为redux表单。有没有一种方法可以保持样式并且仍然可以正常工作,而无需将输入变成
这里是我当前的代码:
<FormGroup row>
<Col sm={6}>
<Input label="sitName" component={renderField} type="text" name="siteName" id="siteName" placeholder={placeholders.siteName}/>
</Col>
<Col sm={6}>
<Input className="form-control" type="select" id="counties">
<option className="selectDefault" disabled value={placeholders.siteCounties} selected>{placeholders.siteCounty}</option>
{ counties.map(c => (<option key={c.value} value={c.value}>{c.display}</option>))}
</Input>
</Col>
</FormGroup>
<FormGroup row>
<Col sm={12}>
<Input type="textarea" name="siteAddress" placeholder={placeholders.siteAdd} id="siteAddress" />
</Col>
</FormGroup>
<FormGroup row>
<Col sm={6}>
<Input type="email" name="siteEmail" id="siteEmail" placeholder={placeholders.email} />
</Col>
<Col sm={6}>
<Input type="tel" name="siteNumber" id="siteNumber" placeholder={placeholders.number}/>
</Col>
</FormGroup>
要使其正常工作,必须像这样:
<Field
name="siteName"
type="text"
component={renderField}
label="Site Name"
/>