Open forgowhisky opened 2 years ago
You get this error when ranges is malformed, in my case my object was:
{
"startDate": "2022-06-01T00:00:00.000Z",
"endDate": "2022-06-29T00:00:00.000Z",
"key": "selection"
}
when ranges should be
[
{
"startDate": "2022-06-01T00:00:00.000Z",
"endDate": "2022-06-29T00:00:00.000Z",
"key": "selection"
}
]
it should be of type array, not object
Hey, if you using class componenet you should pass the value onChange like this : this.setState({range:[range.selection]})
Subject of the issue
When trying to render the component, the following error occurs:
utils.js:69 Uncaught TypeError: Cannot read properties of undefined (reading 'findIndex')
[BUG] Bug Reproduce Steps
Simply install the package on any react app, import it, and render it with
[BUG] Expected behaviour
the app to not crash and the date range picker to display
Environment
Package Version: 1.4.0 React version: 17.0.2 Node version: any Browser: chrome