In React you can manage application's state in many ways. This talk will present you the 4 most popular solutions, with their pros and cons. All this upheld by real case studies.
is described as stateful if it is designed to remember preceding events or user interactions the remembered information is called the state of the system. • Digital logic circuit state • Program state • Finite state machines https://en.wikipedia.org/wiki/State_(computer_science)
application’s state • defines rules how to manage the state • applies not only to UI state, but also to business logic in front-end app • describes how application behaves
State • View state • Cookies • Local / Session Storage Front-end https://www.c-sharpcorner.com/UploadFile/de41d6/view-state-vs-session-state-vs-application-state/
main players • store does all calculations • can be implemented as completely asynchronous Flux MVC vs Flux • bidirectional data flow (two- way binding) • data binding is the key • somewhat synchronous MVC https://syndicode.com/2017/09/19/flux-vs-mvc/
• leads to multiple sources of truth • causes unnecessary renders Cons Pros • easy to learn and use - you probably know it • accessible in all React components • it’s great for maintain state of UI components
State Management • You are managing state? Think twice. • How We Ditched Redux for MobX • The Rise Of The State Machines • Kea vs setState, Redux, Mobx, Dva, JumpState, Apollo, etc.