When using JavaScript, everything works fine. However, when trying to implement TypeScript with the handleChange function, an error is consistently thrown whenever something is typed into the entries. The error message reads: "TypeError not captured: Object (...) is not a function in handleChange."
How can I organize my entries into a useState array of objects?
Within the functional function, I am inserting each object typed through setValues function. I would like to continue doing this.
My values should be structured as follows: values { first name', lastName: 'LastName', email: 'email', phone: '(xx) xxxx-xxxx', local_user: 'External' }
const [values, setValues] = useState ([]);
function handleChange (e) {
setValues ({... values, [e.target.name]: e.target.value, local_user:'External'})
}
Note: This code functions correctly in javascript without any issues.