Sitemap
JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Why useState is like a Notepad: A Fun Explanation

5 min readApr 21, 2025

--

Press enter or click to view image in full size

đź§  Introduction

When you’re first learning React, some concepts might feel a little abstract, especially when dealing with hooks like useState. It’s easy to get bogged down in the technicalities, but what if we told you that understanding useState could be as simple as using a notepad?

Yes, you read that right — useState is like a notepad! This analogy will help simplify how useState works and give you a solid understanding of managing state in React.

In this post, we’ll walk through how useState functions, using a notepad analogy to make it all click. Let’s dive in!

📝 What is useState?

Before we jump into the analogy, let’s briefly explain what useState does in React.

The useState hook is one of React’s most fundamental features. It allows you to add state to functional components. This state can be a number, string, array, object, or any other type of data, and it’s used to manage the behavior and appearance of your app.

Basic Syntax:

const [state, setState] = useState(initialState);
  • state: The current value of the state.
  • setState: A function that updates the state.

--

--

CodeByUmar
CodeByUmar

Written by CodeByUmar

Writing about software engineering, JavaScript, Node.js, AI coding, debugging, system design, and practical lessons from building better software.

JavaScript in Plain English
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.