5 reasons why you should learn React Native
React Native is very popular these days, and thousands of apps are already built using React Native. Big names like Facebook, AirBnB, Uber, and many other companies have embraced React Native and are building their latest apps using React Native.
I have been writing apps in React Native for our startup for almost two years now, and here are some of the things I love about it.
1. If you know Javascript, it is easy to learn
I started writing my first React Native app, with zero prior experience in mobile application development. I knew Javascript, and that was all I needed to get started. Even React was a new concept to me. Web developers can leverage their knowledge in Javascript to write React Native apps.
Facebook’s official documentation is very helpful and provides a good insight into React Native components and APIs.
You are going to learn on the fly as you code. Isn’t that the best way to learn anyways?
2. Hot Reloading! Don’t ever waste time recompiling
This is one of my most favorite aspects of developing React Native Apps. Coming from an enterprise Java background this was huge for me.
Imagine retaining the state of your application and watch it reload as you make your changes. If you are working on a feature few screens away from the main screen, it will require you to navigate through multiple clicks, every time you make changes to the code.
With Hot Reloading, you don’t have to waste any time navigating through those screens to make sure your code worked. The application’s state is maintained, and you get to watch it all reload right in front of your eyes in less than few seconds. The idea is to keep the app running and watch any changes made during runtime take effect, without a complete relaunch of the app.
Cmd+D and “Enable Hot Reloading” does the trick on the emulator.
This saves so much of the developer time. Check out this video to see how it works in action.
3. It builds pure Native Apps
Unlike other frameworks like Cordova that are mostly just a Webview, React Native is used to build truly native apps. Webviews do not provide the natural user experience that comes with React Native.
With React Native the underlying widgets are all native components, hence giving the user a seamless experience. This truly makes a huge difference.
It is really impressive since you are coding in Javascript, and rendering components that are native to the platform. This is one of the reasons that apps built using React Native have a superior user experience in comparison to frameworks that use web-views.
4. Code Once — Works on Android and iOS
The previous example brings me to the next most important reason why I have enjoyed working with React Native — It’s cross-platform capabilities.
You don’t need to know Objective-C, Swift or Java. With Javascript and JSX you build your app which works very well cross-platforms. From my experience, almost 95% of the code is shared between iOS and Android, with minor tweaks to polish the end product on both platforms. Isn’t that just great? You don’t have to have multiple teams and codebases to support the same app cross-platforms.
Instead, you have one team and one codebase that works on both the iOS and Android versions of the app. This is a huge win for small companies and a cost and time saver.
Although I have not tried it yet, React Native works well for Windows too. The more the merrier obviously.
5. Huge Community
Over the last couple years, React Native has gained so much popularity, that there are plenty of developers contributing to make React Native better everyday.
The React Native GitHub repo is open source and has thousands of contributors who are very active.
Stack Overflow là một nơi có rất nhiều tài nguyên và các câu hỏi được trả lời liên quan đến React Native.
Stack Overflow is another place which has plenty of resources and questions answered on React Native.
The community is huge and growing. Many problems have already been solved, and you are most likely not going to re-invent the wheel during your development experience.