How can I write a date using typescript?
I select a date in the picker, and try to write it in the state, but I get an error, how to do it correctly?
const [dateFrom, setDateFrom] = useState<Date | null>(new Date());
onChange={(e, v) => {
setDateFrom(v);
}}
ype '(e: Date | null, v: Date | null) => void' is not assignable to type '(date: Date | null, value?: string | null | undefined) => void'. Types of parameters 'v' and 'value' are incompatible. Type 'string | null | undefined' is not assignable to type 'Date | null'. Type 'undefined' is not assignable to type 'Date | null'.