onefinestay / react-daterange-picker

Other
563 stars 209 forks source link

Setting dateStates or stateDefinitions causes error #197

Open balazsorban44 opened 6 years ago

balazsorban44 commented 6 years ago

I was thinking to separate my problem from #196

When setting dateStates or stateDefinitions, I get the following error message:

I replicated it here, check it out:

Edit yj35o0kz99

AlanFoster commented 6 years ago

@balazsorban44 It seems that you're missing the defaultState prop:

 <DateRangePicker
          defaultState="available"
          ....
 />

The default state is a value from your date states. I'd be happy to accept a PR to better validate this / provide a better error :+1: