我在一个表单中有两个 DayPickerInput 字段,想将它们标记为必填字段,但不知道如何。有人可以帮忙吗?
<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>
更新:我尝试使用 inputProps:
<DayPickerInput inputProps={required} />
但出现错误:
ReferenceError: required is not defined