As a software developer, I’ve spent most of my career working on the backend side of things. Only recently I’ve started developing some React for a pet project.
One of the challenges I face (and I bet every newbie fronteder faces as well) is global state management. I’ve already wrapped my mind around the state of a component, but sharing the state between many components is still a challenge to me. I’ve heard there are some tools like Redux that tackle this issue, but this section in the getting started guide sounded too discouraging for me:
Redux is a valuable tool for organizing your state, but you should also consider whether it’s appropriate for your situation. Don’t use Redux just because someone said you should - take some time to understand the potential benefits and tradeoffs of using it.
A friend of mine recently started using Zustand as an alternative, and the interface looks pretty simple. I think I’m going to dedicate some time to integrate it into my pet project, and only then I will be able to weight the pros and cons, and make a final decision.
To be fair, I think I should listen to Redux’s disclaimer and take the time to understand the potential benefits and tradeoffs. I may do that as well, but didn’t want to lose the opportunity to write down this TIL.
Loyal to my promise, this one took less than 20 minutes to write. Making progress already.