score:1

Accepted answer
function handleChange(e) {
    const { name, value } = e.target;
    console.log(name, value);

    setpollValues(prev => ({
        ...prev,
        answers: {
            ...prev.answers,
            [name]: value
        }
    }));
}

Related Query

More Query from same tag