DEV Community


Discussion on: 3 React Mistakes Junior Developers Make With Component State

annajmcdougall profile image
Anna J McDougall

"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.

thawkin3 profile image
Tyler Hawkins Author

You’re welcome! I’m glad I could help. Keep on learning and being awesome!