// 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}
/>
// regarding this error
// warning: failed prop type: the prop `history` is marked as required in
// `router`, but its value is `undefined`.
// If you are using react-router v4 you need to install react-router-dom.
// After that, import BrowserRouter from react-router-dom and switch Router for BrowserRouter.
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route } from 'react-router-dom'
import App from './components/App';
ReactDOM.render((
<BrowserRouter>
<Route path="/" component={App}/>
</BrowserRouter>
),
document.getElementById('root')
);
// source https://stackoverflow.com/questions/43008036/the-prop-history-is-marked-as-required-in-router-but-its-value-is-undefine
// if you're using react router latest v6
import * as React from "react";
import * as ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
ReactDOM.render(
<BrowserRouter>
{/* The rest of your app goes here */}
</BrowserRouter>,
root
);
// source https://reactrouter.com/docs/en/v6/routers/browser-router