我已经成功实施了 Reac-dates 范围,正如这里解释的那样,我担心的是
这些道具 startDateId 和 endDateId 有什么用???
<DateRangePicker
startDate={this.state.startDate} // momentPropTypes.momentObj or null,
startDateId="your_unique_start_date_id" // PropTypes.string.isRequired,
endDate={this.state.endDate} // momentPropTypes.momentObj or null,
endDateId="your_unique_end_date_id" // PropTypes.string.isRequired,
onDatesChange={({ startDate, endDate }) => this.setState({ startDate, endDate })} // PropTypes.func.isRequired,
focusedInput={this.state.focusedInput} // PropTypes.oneOf([START_DATE, END_DATE]) or null,
onFocusChange={focusedInput => this.setState({ focusedInput })} // PropTypes.func.isRequired,
/>
我知道这可能是一个简单的答案,但我还没有找到解释,它只是说它必须是一个唯一的字符串,我在两个属性上都放了相同的字符串,它仍在工作..