does anybody know why updating specific index value like this doesn't work ?
const [results, setResults] = useState([...Array(data.length)].map(e => []));
const updateResults = (index, value) => { //value is for sur an array of one dimension
let newArray = results;
newArray[index] = value
console.log(newArray) //verifying that it is OK (works well)
setResults(newArray) //has no effect
}
setResults([...newArray])?...was only for objects, and not for arraysetResultsmethod....works for array and objecst. Here you can read more about it developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…