Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 是否可以根据需要设置react day picker的输入字段?_Twitter Bootstrap_Reactjs_React Day Picker - Fatal编程技术网

Twitter bootstrap 是否可以根据需要设置react day picker的输入字段?

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">

我有两个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>

您必须在表单验证级别实现它。签出Formik:

我尝试使用inputProps:

<DayPickerInput inputProps={required} />
<DayPickerInput inputProps={required} /> 
以下是如何将对象作为道具传递:

<DayPickerInput 
   inputProps={
     { required: true }
   } 
/>

如何设置名称、引用属性?
ReferenceError: required is not defined
<DayPickerInput 
   inputProps={
     { required: true }
   } 
/>