Was just curious to know which utility you guys depend on in-order to manage state globally within your React app. Whether it would be Redux, Mobx, Context API or other third party choices, leave down your thoughts below :)
It's all depend on a project architecture.
But I will prefer to divide in the below manner.
Rest API (Stored in DB) -- If Data is going to use for a long time or Even data should persist after app restart. I will store here.
Redux State: it’s my favorite. If data are going to share between a different component of react app. I feel it’s the best place to keep data.
Component State: IF data is only related to a particular component. Please keep it here.
I feel you can get an idea for your choice.
Thanks Maneesh Kumar
Jakob Lind
Full stack developer and independent consultant.
I have different solutions for different projects. I always think through the requirements before I select technologies. This means I don't have a goto solution.
Some times it's obvious what to pick. If I know I'm developing a complex SPA with advanced frontend heavy features, then Redux many times is a good fit. Why not MobX? because we have experience in Redux in the company and are happy with it so far.
If it's not obvisous what to pick at the start, I start without any global statemanagment at all to learn more about what kind of app it is. When the app grows and I get stuck because of the lack of state management, it's usually easier to decide what solution to use.