onefinestay / react-daterange-picker

Other
563 stars 209 forks source link

New idea, meaningful default prop values #198

Open balazsorban44 opened 6 years ago

balazsorban44 commented 6 years ago

As a solution to #197 I propose the following changes:

defaultState and stateDefinitions now has some meaningful default values.

It only makes sense, because the user does not need to always define some values when using the Component. It can still be changed afterward if needed.

AlanFoster commented 6 years ago

I think this would be a backwards breaking change for users of this plugin that don't intentionally don't specify defaultState or stateDefinitions props? 🤔

In your scenario I wonder if a better error message have helped debug the issue faster?

balazsorban44 commented 6 years ago

Yes, you are right, but I wonder what is a use case when you don't need to set these props: :thinking: