Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Failed prop type: The prop `startDateId` is marked as required in `withStyles(DateRangePicker)`, but its value is `undefined`.

// regarding about this error
// Failed prop type: The prop `startDateId` is marked as required in 
// `withStyles(DateRangePicker)`, but its value is `undefined`.

// ctto @majapw from https://github.com/
// startDateId and endDateId are required props on the component (this is recent). 
// We updated this behavior to have parity with the SingleDatePicker and for accessibility reasons. 
// If you add id props on your DateRangePicker you should see the warning go away.

<DateRangePicker 
          startDateId="MyDatePicker" //--> add this
          startDate={this.props.filters.startDate}
          endDateId="MyDatePicker" //--> add this
          endDate={this.props.filters.endDate}
          onDatesChange={this.onDatesChange}
          focusedInput={this.state.calendarFocused}
          onFocusChange={this.onFocusChange}
          showClearDates={true}
          numberOfMonths={1}
          isOutsideRange={() => false}
        />
 
PREVIOUS NEXT
Tagged: #Failed #prop #The #prop #marked #required
ADD COMMENT
Topic
Name
5+2 =