In this session, Trung and his team will be focusing on the following:
– Introduce about React Native
– How to develop an app by using React Native from scratch
– Demo
– Experience sharing
– Q&A
4. What’s React?
● A JavaScript library developed by Facebook
for building user interfaces
● Built upon the concept of Component
4
5. Tools to build mobile apps
5
Hybrid Native
Native components via JS bridge
6. What is React Native?
● A framework for building native iOS, Android
apps using JavaScript and React.
● A React Native app is a “real” mobile app.
6
8. Advantages of React Native
● Build cross-platform mobile apps
● Use native code when you need to
● Integration with existing apps
● Reusable component
● Don't waste time recompiling
8
15. How to run a React Native app?
cd AwesomeProject
// Running on iOS
react-native run-ios
// Running on Android
react-native run-android
// Running on Windows
react-native windows
15
16. How to debug a React Native app?
Default debugger
16
17. How to debug a React Native app?
React Native debugger
17
With React Native, you don't build a "mobile web app", an "HTML5 app", or a "hybrid app". You build a real mobile app that's indistinguishable from an app built using Objective-C or Java. React Native uses the same fundamental UI building blocks as regular iOS and Android apps. You just put those building blocks together using JavaScript and React.
In React, the Virtual DOM acts as a layer between the developer’s description of how things ought to look, and the work done to actually render your application onto the page. To render interactive user interfaces in a browser, developers must edit the browser’s DOM, or Document Object Model.
Let’s come to React Native now. Instead of rendering to the browser’s DOM, React Native invokes Objective-C APIs to render to iOS components, or Java APIs to render to Android components. This sets React Native apart from other cross-platform app development options, which often end up rendering web-based views.
The bridge translates JavaScript calls and invokes the host platform’s underlying APIs and UI elements (i.e. in Objective-C or Java, as appropriate). Because React Native doesn’t run on the main UI thread, it can perform these asynchronous calls without impacting the user’s experience.