Show HN: Tired of logic in useEffect, I built a class-based React state manager

Dev’s “classy” React move sparks cheers, eye-rolls, and a full-on comment war

TLDR: A developer launched Snapstate to move app logic out of React components and into simple classes. The comments split into three camps: fans praising the clarity, critics saying “just use server-side tools like React Query,” and comedians dunking on classes — making this a surprisingly spicy debate about how modern apps should be built

A lone developer dropped Snapstate, a tool that moves app logic out of React components and into plain TypeScript classes, and the internet immediately declared class warfare. Fans say it keeps React focused on rendering while the heavy thinking happens elsewhere — simple, testable, clean. One early supporter even applauded the explicit “write” step in components, calling the pattern easy to reason about, while another team chimed in with a similar approach from Aha!, suggesting this “logic out of the view” trend is having a moment.

But the skeptics are loud. A “use the server, not the browser” crowd insists tools like React Query (a popular server-data helper) already solve most problems — why invent another state thing? Then came the spice: one commenter declared “JavaScript and classes go together like toothpaste and orange juice,” igniting the meme machine and a thousand “hooked vs. classy” jokes. Meanwhile, pragmatists shrugged and said, “Just make a custom hook and move on,” arguing you can tidy components without a whole new store. In short: Snapstate didn’t just tidy state — it split the room into Team Classy, Team Server-First, and Team Keep It Simple, with jokes flying faster than rerenders

Key Points

  • Snapstate is introduced as a class-based state manager that moves business logic from React components into plain TypeScript classes.
  • The article argues React should focus on UI rendering, while application logic should live outside hooks and component lifecycles for better testability and reuse.
  • Existing libraries are evaluated: Redux (predictable but ceremonious), Zustand (light but hook-centric), and MobX (class-friendly but implicitly tracked).
  • Snapstate’s approach emphasizes class-based stores with explicit updates and treats React as an adapter layer, not the logic host.
  • A dashboard example illustrates the anti-pattern of mixing data fetching, derived values, and mutations within components, which Snapstate seeks to avoid.

Hottest takes

"Snapstate instead has an explicit writing step (`scoped()`)" — mjfisher
"for most apps they should really be a function of server, not client, state" — igor47
"Javascript and classes go together like toothpaste and orange juice" — hungryhobbit
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.