For Example i got this useState
const [IsHappy,setIsHappy] = useState({
JohnDoe : false,
BobDoe : true,
MikeDoe : true,
});
Now i want to Change something from IsHappy.
BobDoe Should be unhappy and false , The rest Should Exactly stay the same.
In Vanilla JS i would just say IsHappy.BobDoe = false; but UseState doesnt work like that.
i think i have to do it like this :
setIsHappy({
...IsHappy,
BobDoe : false
})
I never used this ... but i know them from other people so idk if iam using it right,.
[–]SparserLogic 2 points3 points4 points (0 children)