1.

What is Redux in React Native and give important components of Redux used in React Native app ?

Answer»

Redux is a predictable state container for JavaScript apps. It helps write applications that run in different environments. This means the entire data flow of the app is handled WITHIN a SINGLE container while persisting previous state.

Actions: are payloads of information that send data from your application to your store. They are the only source of information for the store. This means if any state change is necessary the change required will be DISPATCHED through the actions.

Reducers: “Actions describe the fact that something happened, but don’t specify how the application’s state changes in response. This is the JOB of reducers.” when an ACTION is dispatched for state change its the reducers duty to make the necessary changes to the state and return the new state of the application.

Store: a store can be created with help of reducers which holds the entire state of the application. The recommended way is to use a single store for the entire application rather than having multiple stores which will violate the use of redux which only has a single store.

Components: this is where the UI of the application is kept.



Discussion

No Comment Found