I'm trying to update my state when onLongPress
triggered.
I'm printing the result right after the setState but it shows nothing (on the first press)
Code:
const [pressedImagesm setPressedImages] = useState([]);
...
onLongPress={() => {
setPressedImages(oldArray => [...oldArray, { [index]: true }]);
console.log(pressedImages);
}}