Use the useState React Hook

Share this video with your friends

Send Tweet

React's new hooks feature allows you to use state in function components in a really simple and elegant way. Let's look at a very basic example of a <Counter /> component that uses the useState React hook.

msm1089
msm1089
~ 6 years ago

Great videos Kent!

Just wondering about the message I see below the playlist tho, about these being outdated:

This lesson is outdated. Click here to find out about changes you should be aware of. React 16.7.0-alpha.0 was recently released and with it comes a set of experimental hooks and features. Use these with caution as they are likely to change in the near future.

Does this actually apply? I am confused about it since this is a very recent set of videos right?

Kent C. Dodds
Kent C. Dodds(instructor)
~ 6 years ago

That's a generic message. What it should say is that this is alpha and therefore prone to changing.