News for hackers. Stuff that matters.
Re:Ask HN: How do you manage state in your React application? by jho406 on Saturday February 09, 2019 @10:35AM (#19122763)
Full disclosure, I’m the author of Breezy, https://github.com/jho406/Breezy. An opinionated state shape and PJAX library for Redux.

I think “how you shape your state to make it easy to reduce and share between components” is an important topic that’s taken a backseat when discussing state management tooling.

Should I repeat my backend models? Should I use a redux ORM? How much should I denormalize or normalize?

I found it much easier to just denormalize everything and shape state for presentational purposes, e.g, I have a bunch of page nodes in my redux state each with a duplicated header. If I need to make an update to the header in response to, say, a change in user email, I change each duplicated header individually.

Sounds insane but it really works for me and let’s me keep more business logic in the backend where it belongs.

There are no comments on this comment yet.