React Native — Flux Architecture Pattern

Prabhu K
2 min readMay 12, 2022

Flux is an architecture pattern used in React / React Native for building a User interface. The application will be split into parts using Flux.

In General Flux Pattern addressing the below pain points in the React / React Native Development

Bidirectional data flow

Due to bidirectional flow, one change caused by the event can loop back and cascade the effect throughout the application

Event Problems

when we couple more and more components tightly and pass an increasing number of listeners down to the props chain

Issues with Binding

When we are going with one way or two-way data binding if the events occur all over the application it's hard to debug and identify the issues.

Flux Architecture

Dispatcher

Will send events to all of the registered components. This manages actions and corresponding call backs. It has register and un register methods for the call backs and also has dispatch method to dispatch actions

Store

The data will be mapped the corresponding views based on the Store call backs registered in the Dispatcher

Action Creators

This will componse the data into a action object and delivered to the Dispatcher.

Sample Data Flow of FLUX Patterns

In the Data flow, all the actions are go to the Dispatcher and then sent to the registered store callbacks. Finally the store content are mapped to the View.

--

--

Prabhu K

Director of Engineering with expertise in Azure Cloud,MicroService and DevOps