How do you update the value inside an array with the useState hook after i used it in a map function?
At the moment i have a handleChange function which works but i want to use the setState() directly inside the onChange in the input field.
const [array, setArray] = useState([1,2,3]);
{array.map((v,i) => {<input onChange={(e)=>setArray([...array, ...v, e.target.value])}/>})}
How do i update the value like this?