Geek Culture
Published in

Geek Culture

The useState Hook in ReactJS

State: hooked.

Just a big fat hook. [Image source]

In this post I’ll be making a quick intro to the useState hook, as well as giving some tips when using it.

useState basics

The useState hook is the most commonly used hook in ReactJS, and helps us with two things:

  • It preserves the value of a variable between renders.




A new tech publication by Start it up (

Recommended from Medium

Animated Active Menu Highlights in VueJS — Daily Vue Tips #1

NestJS serverless with AWS lambda: improve performance with lazy loading

Setup Tailwind with Styled-Components in Create-React-App in 5 Minutes

How to make your sluggish Jest v23 tests go faster

All you need to know about inheritance in Javascript to begin with

Build a Custom VueJS Tag Input in Under 10 Minutes

Reading books: Interactive Data Visualization for the Web by Scott Murray (part 1)

Puzzle Image in React

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dhanesh Budhrani

Dhanesh Budhrani

Multidisciplinary software engineer. Constantly learning. Software Engineer@Wubook. MSc@DTU. BSc@UC3M. LinkedIn:

More from Medium

How to prevent an endless loop when using the useEffect Hook?

What is React and what are its advantages?

What is the React useRef Hook

Token based authentication with local storage in React js with UseContext and useState