hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

Cannot read property 'findIndex' of undefined #504

Open ducnguyenhong opened 2 years ago

ducnguyenhong commented 2 years ago

Subject of the issue

When I don't use the "ranges" props it gives an error. And when I pass the value to it, it works. Your "ranges" props is optional though. Message: Cannot read property 'findIndex' of undefined I have consulted about this error on Google but no response or related post. I think it's the BUG. Hope your team can fix it soon. Thank you!

[BUG] Bug Reproduce Steps

Environment

Package Version: 1.3.0 React version: 17.0.1 Node version: 12.16.1 Browser: Google Chrome

muneebdeveloper commented 2 years ago

@autoclickvn can you share the code that what value are you passing to ranges. Make sure to pass an array to ranges.

forgowhisky commented 2 years ago

wow @autoclickvn really appreciate you following up here. Now that I have the same issue, i am SO HAPPY to see that you solved your issue but didnt report back.

really helpful to anyone who ISNT YOU. not.

fatalcaster commented 11 months ago

For anyone still wondering, you have to define ranges={[]} as a prop. Have fun!