State Management is Hard

09/30/20191 Min Read — In React.js, Lab, Reason

State management in React.js and ReasonReact proves to be challenging.

I have two pieces of state with useReducer, which I can't get synchronized.

Another problem is to conditionally setup useReducer depending on a prop. It probably results from a limitation of ReasonReact because Reason is stricter than JavaScript.

It keeps being exciting to learn new things.

Addendum: Kent C. Dodds wrote an excellent blog post about this topic today: Don't Sync State. Derive It!. This post could offer further insight.

PreviousSick