haoxins / react-flatpickr

flatpickr for React
MIT License
598 stars 102 forks source link

Add ClassName to it's flatpickr-calendar #102

Closed denishrana09 closed 5 years ago

denishrana09 commented 5 years ago

As threre is no answer to this question in react-flatpickr, I just want to reference the answer from flatpickr repo:

https://github.com/flatpickr/flatpickr/issues/1263#issuecomment-369741437

It's useful because flatpickr-calendar is appended not in it's parent component but in parellel of react "root", so when you changes it's css, it's affect everywhere, you can't do like: .myClass .flatpickr-months{ /* some stuff */ } because it's not under your myClass class. if you use the solution then your class will be added where the flatpickr-calendar is.

Hope this helps!