Suggestions

TLDR; Not Your Typical Privacy Agreement

  • This chatbot does not store previous messages. It uses ephemeral message storage meaning your conversation will be lost when you close the browser window.
  • Please cross-reference all AI responses because they may be inaccurate but highly unlikely.
  • This chatbot is free of use and does not require a subscription.

Powered by Cohere

Samsung Galaxy S10e

Specifications

  • Dimensions: 142.2 x 69.9 x 7.9 mm (5.60 x 2.75 x 0.31 in)
  • Weight: 150 g (5.29 oz)
  • Display: Dynamic AMOLED, HDR10+
  • Resolution: 1080 x 2280 pixels, 19:9 ratio (~438 ppi density)
  • OS: Android 9.0 (Pie), upgradable to Android 12, One UI 4.1
  • CPU: Octa-core (2x2.73 GHz Mongoose M4 & 2x2.31 GHz Cortex-A75 & 4x1.95 GHz Cortex-A55) - EMEA/LATAM
  • Main Camera: 12 MP, f/1.5-2.4, 26mm (wide)
  • Selfie Camera: 10 MP, f/1.9, 26mm (wide), 1/3", 1.22µm, dual pixel PDAF
  • Battery: Li-Ion 3100 mAh, non-removable
All Notes

My Hot Take on State Management

Sunday, August 10, 2025
Author:
Share to Reddit
Share to Facebook
Share to X
Share to LinkedIn
Share to WhatsApp
Share by email
Describing the associated blog post


If you're a frontend developer, full-stack guru, or anyone in between, you are probably aware of a concept known as state management. How would I define it in my own words? An efficient method of storing data in the browser by implementing data persistence using various tools. To further explain this, some popular methods for state management are:

  • State management libraries, e.g. Redux, Easy Peasy, Zustand.
  • Built-in methods from frontend frameworks, e.g. Context API in React.
  • Browser URL parameters.
  • Cookies.
  • And last but certainly most, Local Storage.

I specifically want to talk about Local Storage. As a React developer, I've used all of the options I've listed above. Though not exhaustive, these are some of the most common and reliable ways to manage state in the browser. These are the state management methods that I've found to be effective, easiest to implement, and frequently reused in all of the projects I've contributed to.

The Hot Take🌶️♨️🔥

Local storage is the best state management method. Now, before you bite my head off, allow me to explain. I revisited an old project that used Redux and another that used Easy Peasy because I had realized that, despite using these respective tools, I had no idea exactly how they worked under the hood. Is there an invisible database somewhere? Is the state stored on my hard drive? Is there some kind of advanced referencing algorithm that magically remembers all your state when you reopen the browser window?

So I did what I do best, I inspected the browser using developer tools🔍. I checked the cookies, sessions tab, and to my surprise, there the data was, saved in local storage. Neatly packed and parsed in JSON format. I immediately remembered the days before I started using React, when the only way I knew how to handle state was local storage. The point is, most of these tools are just abstractions that allow us to use the underlying technology, so why use them instead of just using local storage directly? A good argument is, why would one want to go through the steps below?

  1. Arrange the data you need saved or persisted in the application's state.
  2. Find a way to safely and correctly convert it to a local storage acceptable format, such as JSON.
  3. Ensure that it is indeed stored in local storage.
  4. Create other methods to retrieve the state from local storage.
  5. Implement various fallback options for null, undefined, or incorrectly formatted data (optional but necessary).
  6. Implementing type safety.

Alternatively, you could just set up efficient state management using the recommendations from the official documentation of each of the tools listed above🤔. This just begs the age-old question: to build it myself or to reuse. That is the question. I really believe that one could efficiently manage application state with local storage only, by writing reusable methods to store and create data using best practices and clean coding techniques, while not relying on a state management library.

I hope you enjoyed this article, and feel free to shoot me a message if you'd like to share some feedback.

Tawanda Andrew Msengezi

Tawanda Andrew Msengezi is a Software Engineer and Technical Writer who writes all the articles on this blog. He has a Bachelor of Science in Computer Information Systems from Near East University. He is an expert in all things web development with a specific focus on frontend development. This blog contains articles about HTML, CSS, JavaScript and various other tech related content.

Comments

Chatbot🤖 - Aug 15, 2025

First comment for testing...

User Notice

Dear Visitor,

This website stores your color theme preference, you can toggle your theme preference using the lightbulb icon in the top right of the webpage.

Clicking on the robot icon that says 'Chat' in the bottom-left corner will open a chat with an AI assistant. Click the button below to close this message.