I have to change the background-color of the popper(which is calender) in my react-datepicker to black with white font color when I toggle the theme from default(white) to black.
I have tried using popperClassName, but unable to pass in the font color and background color, although my placeholder has accepted the given values and changed its background when theme is toggled. I have to achieve the styles inline (JSS - css in js/jsx) way only ! though I have tried the styling of placeholder externally.
<DatePicker
selected={startDate}
dateFormat={DATE_FORMAT}
showMonthDropdown
showYearDropdown
isClearable
todayButton="Today"
popperClassName={{ color: fontColor, background }}
placeholderText="Click to select date"
className={background === '#303030' ? 'placeholderTable' : ''}
onChange={(date) => {
date = moment(date).format(DATE_FORMAT)
if (date === 'Invalid date') {
// this means that the user deleted the date
// this.setState({ start_date: undefined })
this.handleChange({ start_date: undefined, temp_end_date: undefined })
} else {
// this.setState({ start_date: date })
this.handleChange({
start_date: date,
temp_end_date: moment(date, DATE_FORMAT).add(1, 'year').format(DATE_FORMAT)
})
}
}}
/>
I expect some way to modify the styling for the popper using popperClassName or any other way.