Twitter bootstrap 是否可以根据需要设置react day picker的输入字段?
我有两个DayPickerInput字段在表单中,并希望将它们标记为必填字段,但不知道如何标记。有人能帮忙吗Twitter bootstrap 是否可以根据需要设置react day picker的输入字段?,twitter-bootstrap,reactjs,react-day-picker,Twitter Bootstrap,Reactjs,React Day Picker,我有两个DayPickerInput字段在表单中,并希望将它们标记为必填字段,但不知道如何标记。有人能帮忙吗 <FormGroup row> <Col md="4"> <Label htmlFor="begin">Begin</Label> </Col> <Col xs="12" md="8">
<FormGroup row>
<Col md="4">
<Label htmlFor="begin">Begin</Label>
</Col>
<Col xs="12" md="8">
<DayPickerInput value={this.state.begin}
format={settings.formatDate} />
</Col>
</FormGroup>
<FormGroup row>
<Col md="4">
<Label htmlFor="end">End</Label>
</Col>
<Col xs="12" md="8">
<DayPickerInput value={this.state.end}
format={settings.formatDate} />
</Col>
</FormGroup>
您必须在表单验证级别实现它。签出Formik: 我尝试使用inputProps:
<DayPickerInput inputProps={required} />
<DayPickerInput inputProps={required} />
以下是如何将对象作为道具传递:
<DayPickerInput
inputProps={
{ required: true }
}
/>
如何设置名称、引用属性?
ReferenceError: required is not defined
<DayPickerInput
inputProps={
{ required: true }
}
/>