Reputation: 1
I am implementing a material UI datepicker into a TypeScript application. The code functions properly however I am getting a warning in VS code regarding the e.target.value.toISUString()
the error says "Property 'target' does not exist on type 'Dayjs'"
I am not exactly sure why I get this message as I am only looking for 'target' on the onChange event and it does exist.
<MuiDatePicker
id="reminderDate"
name="reminderDate"
label="Reminder Date"
fullWidth={true}
value={reminderDate}
onChange={(e) => setReminderDate(e.target.value.toISOString())}
views={["month", "year", "day"]}
disablePast={true}
// onClose={onClose}
sx={{ paddingBottom: "12px" }}
/>
I have tried tweaking the naming conventions (using event instead of e) but that didn't fix anything.
Upvotes: 0
Views: 21