State management, Mamo, 2024
Bringing Redux to Mamo’s dashboard
In early 2024, Mamo’s merchant dashboard had no state management library. Shared state lived in React’s useState and createContext, and that was it. I compared six options, we picked Redux Toolkit together on a call, and I added it with the payment link redesign in March 2024. By March 2025 the dashboard had 17 slices, 10 of them written by other engineers.
- Stack
- My part
What Context couldn’t do
Context is good at values that rarely change, like the signed-in merchant or the language. It gets expensive when the value changes often. Every component that reads a context re-renders when anything in it changes, even the part it doesn’t use. A form is the worst case: each keystroke in one field re-renders every field and every preview reading the same context.
That was how Verification, Expenses, Payment links and Payments held their state. It also made changes hard to trace. When a value went wrong, there was no single place that showed what changed it.
PaymentLinkPageHeaderreads merchantLinkFormAmountFieldreads amountCurrencyPickerreads currencyTitleFieldreads titlePreviewreads amount, currency, titleComparing six options
I wrote up React Redux, Redux Toolkit, Redux Saga, Zustand, MobX and the Context API we already had, each against the same questions. Does a component re-render only when the value it reads changes? Can the state survive a reload? How big is the community, and how much setup does it need?
Context was the only one that failed the first question. Zustand was the lightest, but its ecosystem was small and it wasn’t clear it would hold up in an app the size of the dashboard. MobX was easy to start with and harder to debug. Plain Redux needed a lot of boilerplate, which is the problem Redux Toolkit was made to solve. Saga added generators and middleware we didn’t need.
We talked it through on a call and went with Redux Toolkit.
| Option | Re‑renders only what changed | Keeps state on reload |
|---|---|---|
| Context APIWhat we had | No | Yes |
| React Redux | Yes | Yes |
| Redux ToolkitChosen | Yes | Yes |
| Redux Saga | Not on its own: it’s middleware for Redux | Not on its own: it’s middleware for Redux |
| Zustand | Yes | Yes |
| MobX | Yes | Yes |
Starting with one slice
I didn’t migrate the app in one go. Redux came in with the redesign of the create payment link flow in March 2024: one store and one slice for the form. A slice holds a piece of state and the functions that change it, and each component picks only the values it needs with useSelector. That is what fixes the re-render problem: the amount field and the preview subscribe to the amount, and the title field doesn’t.
The form was the right place to start: it had the most fields reading the same state, and the redesign couldn’t meet its UX requirements without shared state.
How it spread
Other engineers started writing slices for their own features about six weeks later: tables, cards, sign-up, accounting settings. I moved Verification and the expense details page over, and added slices for the global banners, permissions and the navigation. I moved to design in August 2024, and the team kept adding slices after that.
Context didn’t go away, and it didn’t need to. It stayed for small, local state. The store took the state that many components share.
17 slices between March 2024 and March 2025: 7 written by me, 10 by other engineers. I moved to design in August 2024; other engineers added five more after that.
Would I pick it again?
Probably not. Better tools have come along since. But for our use case, with what was around in early 2024, it was the best fit we had.