Having some free time lately, I found myself browsing the React Native docs and found it amazing. I would have been hugely disappointed in myself if I did not try this out.
Choosing the project
I did not have to think a lot on the kind of project to do in React Native. I did not want to write a server code for the app because the whole objective of the project was to learn React native and it would be an unnecessary burden on me writing a server. So options were clear —
- Write a client-only app. e.g. An alarm clock or the classic To-do app. I could not come up with something interesting in the category.
- Consume an API service and write a client. A Reddit client! Yes! That way I can use my app for browsing reddit and make incremental improvements to the app as well.
(Reddit API is quite straight forward and easy to grasp. Let us not go into its details as it would dilute the purpose of the article)
Setting up React Native was quite easy. You get the required libraries from npm, and that is it. Use your favorite editor/IDE and you are good to go. Personally, I would recommend using Atom by GitHub and installing the Nuclide package but people use vim or emacs with appropriate packages as well.
I would say if you have a strong component-based programming experience, the learning curve would be much smoother. Otherwise, it might take you a while to grasp a few concepts but it should not be a tough nut to crack.
Anyway, as my app began to grow I ran into a problem ( as is the case with developers ). In React, state is essentially the core of the application, which determines how each component behaves and renders. In my case, the state of the application was being changed from a lot of places and soon it was difficult to track from which modules of my app the state was being changed.
Essentially a simplified Flow. It provides a framework to manage your state changes. It works on the principle of Action acting upon Current State, provides the Next State. React Native works coherently with the Redux Framework and solves much of your state change issues.
To me, React Native does look like a strong contender for the future of mobile app development. What remains to be seen is how this affects the current mobile app dev platforms.
Google looks comfortable with its Java based Android SDK, although there was a rumour Google switching from Java to Swift after it’s lawsuit with Oracle ( which I find it unlikely in near future ). If that does happen, ‘learn once, write anywhere’ methodology is satisfied sans React Native with the perspective of a mobile apps.
And with Apple pushing its Swift language and rolling out updates, the stage looks set. What stands the test of time, remains to be seen.