I found this expression, but I do not know where is it come from? Where is any documentation for it?
onChange={(
event: React.ChangeEvent<HTMLInputElement>
) => {
setFormData({ ...formData, [key]: event.target.value })
}}
You can just put any key name here i chose eventValue
setFormData({..formData, eventValue: event.target.value})
and then you should be able to access it like this
function setFormData(formDataObject){
// access it like this
formDataObject.eventValue
}