React State Feels Simple — Until It Doesn't
React state management often feels more complex than it needs to be.
Selectors, memoization, dependency arrays…
we spend a lot of time managing how state updates, not just what the state is.
Recently, I tried Valtio — and it made me rethink some of these patterns.
The usual problem
In many React setups, especially as apps grow, state logic tends to spread:
- UI state and business state get mixed
- we add selectors to control updates
- we optimize re-renders manually
- we introduce more abstraction to keep things under control
It works — but it requires constant orchestration.
What felt different with Valtio
Valtio takes a different approach based on proxies.
Instead of thinking in terms of update triggers and subscriptions, you work directly with state:
import { proxy } from 'valtio';
const state = proxy({ count: 0 });
function increment() {
state.count++;
}
In a component:
import { useSnapshot } from 'valtio';
function Counter() {
const snap = useSnapshot(state);
return <button onClick={() => state.count++}>{snap.count}</button>;
}
That's it.
- No selectors
- No dependency arrays
- Minimal boilerplate
Why this matters
The real benefit isn't "less code".
It's less mental overhead.
With this model:
- you don't think about when to re-render
- you don't orchestrate updates manually
- you focus on state, not the mechanics around it
It feels more reactive than controlled.
But this doesn't remove complexity
To be clear: complexity doesn't disappear.
In real-world apps, especially with:
- dynamic forms
- derived state
- async flows
you still need structure.
But shifting complexity away from orchestration makes things easier to reason about.
Where this gets interesting
This approach becomes even more relevant in areas like:
- complex forms (React Hook Form, MUI, etc.)
- dynamic UIs with dependencies between fields
- state that evolves frequently during development
That's usually where traditional patterns start to show their limits.
Final thought
Valtio won't replace every state management solution.
But it challenges an important assumption:
Are we managing state… or managing the complexity around it?
Curious how others are approaching state management lately.
Top comments (0)