How do I set a react state with a event.target.value in a datetime picker?
Here is my code that is not working:
const [ date, setDate ] = useState(new Date());<input type="datetime-local" className="form-control" onChange={event => setDate(event.target.value)} value={date}/>
Here is the error that shows me:
Argument of type 'string' is not assignable to parameter of type 'SetStateAction'.ts(2345)
Do you know how can I fix this?