Here, I'll give you a brief, not necessarily
a comprehensive view of how React Native actually works, but
just sufficient enough for us to understand how React Native works.
The actual details of how React Native actually accesses the native device
capabilities and so on is not necessary for us to understand completely.
Because we'll be mainly remaining within the React Native
ecosystem while accessing the device capabilities.
So when you go to any native platforms, so you have the entire native platform.
So if you want to target the native platform, obviously,
we realize that the only way to do so is to use the native
development environment and the corresponding languages for the purpose.
Now in this course, our idea is to use hybrid development
using JavaScript as the language of choice.
So we will look at the native platforms, the two native platforms,
Android and iOS, the two halves of this entire landscape.
And so how do we target each of these two platforms?
So this is where we will understand that Android has the V8 JavaScript engine.
And then iOS has the JavaScript code, JavaScript engine, which is used
by the browsers in each of these platforms to run the JavaScript code already.
So we have a virtual machine already that understands JavaScript and
is able to run the JavaScript code, so why not build on top of that?
And that is where React Native puts in its bridge into the native environment.
The bridge that taps in though these virtual machines into
the native devices capabilities.
And on top of that, we built React Native itself, which is implemented in
JavaScript and then partly implemented in native code.
But that part is completely hidden from us.
And so we access by writing React Native application code
on top of the React Native framework.
And the application code is completely written in JavaScript.
Now when you need to render your user interface in either of the two platforms,
then both of these will access the native UI elements,
whether it is in Android or whether it is in iOS.
They will access the native UI elements and
then leverage them while rendering the user interface for both the platforms.
Now this part is automatically taken care of for
us by the React Native platform itself.
And so we can live in the comfort of the JavaScript environment and
write our code completely as if we are writing a React Native application and
be able to leverage all of the native device's capabilities.
In this context, we will also encounter the Expo SDK,
which I will talk about in a little detail in the next lecture, in the exercise.
And then also in a lot more detail in the last module of this course,
where we will look at accessing the native device's capabilities in lot more detail.
So how do we get started with React Native development?
First and foremost, you used to go and access and
install the React Native development tools.
And we're going to leverage the create-react-native-app
command line tool to enable us to do our React Native development.
The create-react-native-app tool sets up the entire ecosystem for
our React Native app development.
It sets up all the things, like if you read about React Native, you would hear
people mentioning about Babel and then doing transpiling and things like that.
We are completely isolated from that part by using the React Native app,
because that sets up this whole environment for us.
And so we are left in the comfort of doing just JavaScript application development.
And that's the reason why I chose to leverage
the create-react-native-app way of doing React Native development.
Now once we install that, then we will be able to scaffold out a React Native app by
simply saying, create-react-native-app, and then give a project name to that.
And then it'll scaffle out the project directory with the necessary
files to get you started in React Native app development.
This is exactly what we will do in the very next exercise that follows
this lecture.
And the create-react-native-app leverages the Expo SDK for helping us to setup
the environment where we can comfortably do our React Native app development.
And so we will explore Expo SDK briefly in the next lecture, and
then also examine it in more detail in the last module.
With this quick understanding of React Native, let's move on to
get some hands on experience with development React Native applications.
[MUSIC]