react-modern-calendar-datepicker
react-modern-calendar-datepicker copied to clipboard
required attribute
hi, how can I set the required attribute for DatePicker?
<DatePicker
id="selectedDay"
value={selectedDay}
onChange={setSelectedDay}
shouldHighlightWeekends
locale="fa"
name={selectedDay}
wrapperClassName="d-block"
/>
hi,
you can use -> renderInput attribute .
like this:
const renderCustomInput = ({ ref }) => (
<input .../>
);
<DatePicker
id="selectedDay"
value={selectedDay}
onChange={setSelectedDay}
shouldHighlightWeekends
locale="fa"
name={selectedDay}
wrapperClassName="d-block"
renderInput={renderCustomInput}
/>
how can I change in typescript?