We have started developing with React Native after working on ionic 2 projects for a while. And during development with React (JS/Native) we need to work with Redux as the underlying data provider. Although it is not a requirement, and in addition to that, understanding ReactJS/ReactNative with Redux seemed difficult at first. But it proves to be very useful in separating modules in Application structure.
Developing with Redux as Model, and ReactNative as View, we can have pure (purely presentational) React components whose sole responsibility is how things look, are independent of other components, and don’t care about how data is loaded / mutated.
And then we can have stateful components that are concerned with how things work, provide and mutate data for those pure components.
The separation of concerns:
- helps developing better component with clear responsibilities.
- speeds up development by developing both the View (pure), ViewModel (stateful) and Model (redux) simultaneously without coupling based on dependency injection.
- creates reusable components since logic and UI are separated clearly.
This proves to be the clear advantage over Angular in ionic, since integrating Redux into React projects is trivial, while it is not the case with Angular projects.