Member-only story

Get to Know the UseState Hook in React.js

Because functional components are awesome

Jonathan Brierre
Better Programming
4 min readNov 30, 2020

--

useState Hook in action
Photo by the author.

Today, we are going to take a look at the useState Hook in React. This article will be the first part of a series of posts on React Hooks. The link for the demo repo used in this article can be found below:

Assumptions

  • You understand basic state functionality in React.
  • You understand basic JavaScript event handling.
  • You understand basic functional programming.

Let’s Get to It!

The following is a comparison between two controlled input fields. One is using class state and the other is using functional state with the useState Hook.

Visual comparison between class state and functional state.

If you are unfamiliar with controlling your input fields in React or why it is essential to control them, feel free to check out my previous article on…

--

--

Jonathan Brierre
Jonathan Brierre

Written by Jonathan Brierre

I am a published author as well as a software engineer. I like thinking, thinking about thinking, and thinking about how I think about the things I think about

No responses yet

Write a response