Many times I a faces troubles with understanding why a function is not working without putting return keyword or curly braces
for example here I have only one object after the arrow so what is the need for return and curly braces here?
function handleChange(event) {
setFormData((preValue) => {
return {
...preValue,
[event.target.name]: event.target.value,
};
});
}