- Flux is an architecture that Facebook uses internally when working with React. It is not a framework or a library.
- It is a kind of architecture that complements React as a view and follows the concept of the Unidirectional Data Flow model.
- This data enters the app and flows through it in one direction until it is rendered on the screen.
Flux applications have below major roles while dealing with data:
1.Actions – Actions are the helper methods that pass the data to the dispatcher.
2.Dispatcher – Dispatcher is a central hub for the React Flux application and manages all data flow of your Flux application.
3.Store − Store is the place where the application state and logic are held. Every store is maintaining a particular state and it will update when needed.
4.View – It is a React component that listens to change events and receives the data from the stores and re-render the application.