"The key here is that if your new state relies on the value of the old state, you should always use a function as the argument."
I knew this already but your example really helped clarify it. Thank you for sharing! As a React newbie this kind of post is super useful to me to solidify what I'm learning.
"The key here is that if your new state relies on the value of the old state, you should always use a function as the argument."
I knew this already but your example really helped clarify it. Thank you for sharing! As a React newbie this kind of post is super useful to me to solidify what I'm learning.
Youβre welcome! Iβm glad I could help. Keep on learning and being awesome!