aboveyunhai / chakra-dayzed-datepicker

Chakra UI + Dayzed = datepicker
https://aboveyunhai.github.io/chakra-dayzed-datepicker/
MIT License
223 stars 46 forks source link

Date prop not optional #2

Closed naodya closed 2 years ago

naodya commented 2 years ago

The date prop always expect a Date, ideally it should work if date is not supplied.

aboveyunhai commented 2 years ago

The date prop always expect a Date, ideally it should work if date is not supplied.

You can simply provide your own default date={new Date()}

If you just want it to work without useState hook, it means I will have to encapsulate the date state for you. Then it will be difficult for user to use date state outside of the component. For example, use it inside Formik, the state hook leaves a lot of flexibility to user. Actually, that's the primary reason why I create the lib at that moment.

I'm actually rolling out the date range picker due to the project need. So idk something might change.