react-date-range icon indicating copy to clipboard operation
react-date-range copied to clipboard

Cannot read property 'findIndex' of undefined

Open ducnguyenhong opened this issue 4 years ago • 3 comments

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

  • I use the DateRangePicker and don't use props "ranges".

Environment

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

ducnguyenhong avatar Jul 31 '21 02:07 ducnguyenhong

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

muneebdeveloper avatar Aug 06 '21 15:08 muneebdeveloper

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.

forgowhisky avatar Jun 11 '22 16:06 forgowhisky

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

fatalcaster avatar Jul 31 '23 23:07 fatalcaster