I'm trying to handle change in multiple input text field and send the value to an API Here is what i have tried
const [state, setState] = useState({
Value_A:'',
Value_B:'',
Value_c:'',
Value_D:'',
Value_e:''})
The handleChange function right here
function handleChange(evt) {
const value = evt.target.value;
setState({
...state,
[evt.target.name]:value
})
}
So how can I do to get those values inside the function handleSubmit()
const handleSubmit = (e) => {
const a = {
// How to get those values here?
Thank you!