Hey Guys,

I’m currently learning React and find it interesting. Ive come across ES6 destructuring before but i’ve never seen this kind of use in the docs.

My question is, how did the tutor know that the 2nd variable in the array while destructuring [count, setCount] = useState(0) cause the setState value to change? I’m trying to get my head around just this bit of code that causes the setState to change values? If possible, can anyone point me to the docs where this functionality is mentioned? Or maybe a keyword that i can use to search it up. I’ve been checking around but can’t find the answer as i’m not sure what to call this

Post image

Source link

Write A Comment