I Built a State Management Library That Works Like React's useState — Meet CreateStore
If you've worked with React, you've probably used useState countless times.
It's simple, predictable, and gets the job done.
But as an application grows, things get a little more complicated. You have components deeply nested in the component tree that need access to the same state. Suddenly, you're passing props through multiple components, introducing Context Providers, or bringing in a state management library with its own concepts and boilerplate.
I kept thinking:
Why can't sharing global state be as simple as using useState ?
That question led me to build CreateStore , a JavaScript state management library that I've recently published on npm.
In this article, I'll walk through the problem, how CreateStore approaches it, and how you can start using it in a React application.
The problem with sharing state in React
Let's say we're building a simple todo application.
We have two components:
TodoCount –…