Welcome to A Look at React Hooks, a beginner-friendly series on React Hooks. In this article, let's look at the useState Hook. What is useState? This Hook is probably the most commonly used Hook. It allows us to declare, read and update a state varia...

Markdown supported · ⌘↵ to post
Hi Victoria, from what i see in your article about useState hook, you often use a function that returns updated state value rather than directly write the updated value as an argument. if that sounds confusing, let me direct it with an example:
instead of just this:
my question is, is that necessary to do so? i'm sorry if my question sounds stupid to you, but i am kind of new to programming. best regards, Ilham.
Hey Victoria Lo. I really enjoyed reading the second article of this series, and I am looking forward to the third one.
I have a question for you. 😀

Concerning lazy initial state, are you saying passing a default state makes the app slower because React will always rerender it?
Interesting read Victoria, I once ran into an error using this
setCount(count++)
Is there a reason why the example above doesn't work? I'll like to know and also thanks for sharing 🤩.
"Great article! As a junior developer at a software agency with less than two years of experience, I found your explanation of how useState works to be very helpful. You've presented the topic clearly and concisely, making it easy for beginners like myself to understand. I appreciate the code examples you provided as they allowed me to see how to implement this hook in my projects. For those who want to learn more about using useState, I recommend checking out this React usestate blog, which specifically focuses on this topic. It covers how to use useState effectively and provides practical examples of how to implement it. I think it would be a great complement to this article. Thanks again for sharing your insights. I'm looking forward to reading more of your articles on React Hooks!" copycat.dev/blog/react-usestate-hook