Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,240 --> 00:00:05,390
Oh, boy, that was a lot of slides and talking on my part, but I think you're getting excited.
2
00:00:05,400 --> 00:00:10,680
So let's start building our very first react native app just like that.
3
00:00:11,190 --> 00:00:17,370
Now, throughout the course, I'm going to keep referencing the React Native Dock's because I don't
4
00:00:17,370 --> 00:00:23,370
want to just teach you things that you only learn by looking at what we do as instructors.
5
00:00:23,370 --> 00:00:28,290
But I want to show you the process so that after you're done with the course, you know how to go off
6
00:00:28,290 --> 00:00:34,650
on your own, because at the end of the day, the best resources are right here on the Riak native dock's.
7
00:00:34,890 --> 00:00:40,770
While we try to teach you is the process of what are the best practices, how do we learn these things?
8
00:00:40,770 --> 00:00:44,320
How do we find out about things that maybe we're confused about?
9
00:00:44,730 --> 00:00:51,330
So you're going to see us use their react native dock's constantly because that is the process that
10
00:00:51,330 --> 00:00:53,810
we use when we build Riak native apps.
11
00:00:54,720 --> 00:01:00,300
So the first thing is when we go to introduction, if you scroll all the way down, there's an interactive
12
00:01:00,300 --> 00:01:04,200
example section which are linked to now in here.
13
00:01:04,770 --> 00:01:09,180
Even if you've never seen Riak native code or even react code, don't worry.
14
00:01:09,210 --> 00:01:15,600
Just see if we can follow along or we're going to do is click on this little icon over here.
15
00:01:16,380 --> 00:01:24,390
And this is going to open up a new tab where we have some code, an interactive online code, Ed, that
16
00:01:24,390 --> 00:01:25,170
we can use.
17
00:01:25,170 --> 00:01:29,760
And this is our app over here to the right that says try editing me.
18
00:01:29,970 --> 00:01:30,990
Nothing too crazy.
19
00:01:32,100 --> 00:01:34,670
You see here that we also have the Web version.
20
00:01:34,680 --> 00:01:39,540
So right now I'm just seeing it on my Chrome browser, but I can also do Android.
21
00:01:41,050 --> 00:01:42,520
I can do AOS.
22
00:01:44,570 --> 00:01:45,660
And emulate it.
23
00:01:46,190 --> 00:01:56,110
So if I do tap to play on iOS, sometimes you might get this prompt now because this is a free service,
24
00:01:56,300 --> 00:02:00,620
sometimes you get placed in a queue that is a line up where other people are using it.
25
00:02:00,620 --> 00:02:07,940
So you just have to wait your turn, which takes a bit of time, or you can just say run on your device
26
00:02:07,940 --> 00:02:12,020
and it actually gives you a QR code to run on your phone.
27
00:02:12,410 --> 00:02:17,060
Now, we're going to get into this a little bit later on, because in order for this to work on your
28
00:02:17,060 --> 00:02:21,690
phone, you're going to need to download something called the Expo app, which we're going to talk about.
29
00:02:22,430 --> 00:02:26,870
We're going to run through how to download that through the Google Play store and also for the App Store
30
00:02:26,870 --> 00:02:29,470
before now, because we're just getting started.
31
00:02:29,990 --> 00:02:32,180
We're going to just stick with the Web.
32
00:02:33,730 --> 00:02:41,110
And just to see that we can code anything we want in here, let's just write a nice hello message in
33
00:02:41,110 --> 00:02:43,120
here if I save.
34
00:02:44,090 --> 00:02:51,050
You see that my app now says hello, congratulations, that's your very first react native app, but
35
00:02:51,230 --> 00:02:52,940
Brunos not going to be impressed with this.
36
00:02:52,970 --> 00:02:54,290
This is pretty basic.
37
00:02:55,070 --> 00:02:59,840
But what I want to do is talk about the principles, the building blocks of reac native.
38
00:02:59,960 --> 00:03:05,720
So we actually understand what this code does, whether, you know, react or not.
39
00:03:06,050 --> 00:03:11,060
We can actually understand what the building blocks are of react native.
40
00:03:12,740 --> 00:03:18,590
Now in the Riak native dock's, the second part after the introduction is this idea of core components
41
00:03:18,710 --> 00:03:27,560
and native components, because if you remember, what Riak native does is compile whatever code we
42
00:03:27,560 --> 00:03:29,440
write into native views.
43
00:03:29,870 --> 00:03:30,740
What do I mean by that?
44
00:03:31,220 --> 00:03:39,200
You see, in Android and iOS, a view is the building block of UI or of the user interface.
45
00:03:39,860 --> 00:03:48,080
That is these rectangular elements on the screen, whether it's an image, a Nerf bar, a title, a
46
00:03:48,080 --> 00:03:51,200
text, all of these are called views.
47
00:03:51,710 --> 00:03:53,240
A line of text is a view.
48
00:03:53,240 --> 00:03:54,290
A button is a view.
49
00:03:54,470 --> 00:03:55,610
A list is of you.
50
00:03:56,930 --> 00:04:03,740
A view can contain a view, for example, here, this big thing is a view that contains another view
51
00:04:03,740 --> 00:04:10,700
that contains this view, as you can see over here, and that's how you can think about native development.
52
00:04:10,730 --> 00:04:13,540
You're just building these rectangles all over the place.
53
00:04:16,180 --> 00:04:22,930
Free scroll all the way down over here, we see that react native has something called core components
54
00:04:23,500 --> 00:04:28,720
and what core components are are these building blocks that react native gives us?
55
00:04:28,900 --> 00:04:34,510
You see over here that we have view, text image, scroll view and text input.
56
00:04:35,380 --> 00:04:40,150
What we act native does is it allows us to use these components.
57
00:04:40,300 --> 00:04:48,100
As you can see in our code here, we're using view and text and we're importing it from the React Native
58
00:04:48,100 --> 00:04:56,020
Library and react native automatically converts these into native Android view, which is called view
59
00:04:56,050 --> 00:04:57,070
group IOS.
60
00:04:57,070 --> 00:04:58,240
It's UI view.
61
00:04:58,390 --> 00:05:03,280
The tax will become a TextView in Android and a UI TextView in iOS.
62
00:05:04,210 --> 00:05:13,390
So react native inside the hood is actually converting it, compiling this into a native view so that
63
00:05:13,390 --> 00:05:14,380
it's performant.
64
00:05:15,070 --> 00:05:16,630
That's what really native is.
65
00:05:16,840 --> 00:05:25,690
It lets you build your own components for Android and iOS to build those rectangular boxes of view.
66
00:05:26,560 --> 00:05:29,530
And these rectangular boxes of you is right here.
67
00:05:29,770 --> 00:05:31,810
A view is wrapped.
68
00:05:33,090 --> 00:05:37,150
And inside of it is a text and there's the text.
69
00:05:37,380 --> 00:05:38,550
That's a view.
70
00:05:41,130 --> 00:05:47,280
So react native gives us two things, it gives us the components we can use.
71
00:05:48,770 --> 00:05:54,920
Right here and you can see here we have basic components like view, tax, text, input and image that
72
00:05:54,920 --> 00:05:55,460
we can use.
73
00:05:55,640 --> 00:05:57,280
It has user interface.
74
00:05:57,290 --> 00:06:01,420
So if you go to user interface, we have things like switch and button that we can use.
75
00:06:01,700 --> 00:06:04,040
We have list views that we can use.
76
00:06:04,220 --> 00:06:12,680
And then we also have iOS and Android specific components like action sheets, like back handler, because
77
00:06:12,680 --> 00:06:14,510
on Android you have the back button.
78
00:06:16,080 --> 00:06:23,190
And you have some other ones, like alert dimensions, so react native gives us these components, plus
79
00:06:23,190 --> 00:06:25,450
it gives us something called APIs.
80
00:06:25,680 --> 00:06:29,440
These are tools that we can use inside of Riak native.
81
00:06:30,150 --> 00:06:36,590
For example, let's say I want to figure out the dimensions of a user's phone.
82
00:06:37,170 --> 00:06:44,250
It gives us the dimensions API so that we can measure the dimensions of a phone.
83
00:06:45,060 --> 00:06:45,510
That's it.
84
00:06:45,660 --> 00:06:46,500
React native.
85
00:06:46,500 --> 00:06:50,700
All it does, it gives us these components and the app eyes.
86
00:06:51,600 --> 00:06:56,430
And that's why when we go to our code here, we see that from REAC Native.
87
00:06:56,430 --> 00:07:00,220
We're simply importing a text component and a view component.
88
00:07:00,570 --> 00:07:09,660
So if we go back and review, what we've learned is that react native, the library and the framework
89
00:07:09,780 --> 00:07:13,680
gives us a bunch of components that we can use.
90
00:07:13,890 --> 00:07:20,790
And these components are compiled to native code, both on iOS and Android, depending on what phone
91
00:07:20,790 --> 00:07:24,360
we're using, so that they're super performant and fast.
92
00:07:25,170 --> 00:07:27,120
And it also gives us APIs.
93
00:07:27,420 --> 00:07:32,220
That is, it gives us information that we can interact with about the phone like phone dimension's.
94
00:07:32,400 --> 00:07:38,370
And you saw on the documentation that there's two TAPS components and API and those are the tools that
95
00:07:38,370 --> 00:07:40,620
we get to use to build our apps.
96
00:07:41,820 --> 00:07:43,120
And here's the exciting part.
97
00:07:43,200 --> 00:07:47,400
We have these two things from React Native, but then we need another piece.
98
00:07:47,940 --> 00:07:53,040
And this other piece is this Famous libris react.
99
00:07:53,730 --> 00:07:58,200
And in this course, there's going to be a path for you to take if you're brand new to react so you
100
00:07:58,200 --> 00:07:59,030
can get caught up.
101
00:07:59,040 --> 00:08:00,570
So don't worry, we'll get into that.
102
00:08:01,020 --> 00:08:07,860
But because we act native only gives us the components and the APIs, we then use their react library
103
00:08:08,430 --> 00:08:12,340
to then know what to display on our phones.
104
00:08:12,390 --> 00:08:13,020
What do I mean?
105
00:08:13,770 --> 00:08:20,730
You see here that we also import the REACT Library because without the react library react native doesn't
106
00:08:20,730 --> 00:08:23,370
know react specific things.
107
00:08:24,350 --> 00:08:31,790
For example, later on, we're going to use concepts like state and props and react components that
108
00:08:31,790 --> 00:08:38,750
isn't necessarily JavaScript there, react specific, and we need this library in order for us to combine
109
00:08:38,960 --> 00:08:41,150
all these things into a view.
110
00:08:41,810 --> 00:08:45,020
Now, we'll dive deeper into that later on in the course.
111
00:08:45,260 --> 00:08:47,780
But that's the building block.
112
00:08:47,810 --> 00:08:54,290
The building block is that we need to react and react native for us to display the views that we want.
113
00:08:55,610 --> 00:09:01,340
And if we go back to the docks and go to core components and native components at the very bottom,
114
00:09:01,340 --> 00:09:08,240
there's a really good diagram that shows us the entire idea behind React Native.
115
00:09:09,150 --> 00:09:15,480
That is react native gives you a bunch of components which are called core components.
116
00:09:16,450 --> 00:09:21,910
It also has something called community components, so people can build these components and share them.
117
00:09:22,180 --> 00:09:23,230
For example, there's.
118
00:09:24,580 --> 00:09:27,760
A native directory to find out.
119
00:09:28,750 --> 00:09:33,100
At React Native Directory to see what other people have built.
120
00:09:35,290 --> 00:09:38,710
So you can use these native components that you want.
121
00:09:41,280 --> 00:09:48,150
From the outside world, there's your own native components that you can build, and then there's this
122
00:09:48,150 --> 00:09:54,960
idea of react components and the react components is something that, again, you'll build yourself.
123
00:09:55,860 --> 00:10:03,840
In our case, in our snack, this your app is our own component that will be building again, if you're
124
00:10:03,840 --> 00:10:07,360
new to react, don't get too overwhelmed because we'll go through this as well.
125
00:10:08,490 --> 00:10:13,620
But just through this, you've learned something important that we're going to do throughout the course,
126
00:10:14,130 --> 00:10:21,150
we're going to follow a simple four step process as we build out our UI, we're going to be writing
127
00:10:21,330 --> 00:10:26,460
JavaScript code with the REACT Library to essentially do four things.
128
00:10:26,850 --> 00:10:33,780
One is we usually import the tools that we need, so we import react and then we import whatever react
129
00:10:33,780 --> 00:10:36,060
native components or APIs that we need.
130
00:10:36,540 --> 00:10:38,880
We then create our own components.
131
00:10:39,150 --> 00:10:44,910
Let's call this one zero to mastery and there's zero to mastery, will have some views, will have some
132
00:10:44,910 --> 00:10:47,460
style and we'll have some text.
133
00:10:48,680 --> 00:10:57,320
And then we usually can do some fun things like creating styles for our component, and this stylesheet
134
00:10:57,320 --> 00:11:01,900
is an API that Riak native gives us so we can import that right over here.
135
00:11:02,890 --> 00:11:04,510
And import stylesheet.
136
00:11:05,450 --> 00:11:12,020
To create styles in this styles now, instead of writing it in line like this, we might be able to.
137
00:11:13,270 --> 00:11:21,460
Write it like so so the steps are important, whatever tools we need, create our components, add our
138
00:11:21,460 --> 00:11:27,240
styles, and then finally we export this component so we can use it in other parts of the app.
139
00:11:27,520 --> 00:11:28,540
You remember what I said?
140
00:11:28,690 --> 00:11:30,370
Rectangles and rectangles.
141
00:11:30,370 --> 00:11:31,270
It's all views.
142
00:11:31,300 --> 00:11:37,140
We're just building out these views so that in the end it looks like a screen on the phone.
143
00:11:39,030 --> 00:11:46,020
So to finish off, go and play around with this online Reppel, see if you can look at some of the core
144
00:11:46,020 --> 00:11:52,280
components and modify some of these things to display different information on your app.
145
00:11:52,530 --> 00:11:53,940
And I'll see you in the next video.
15196
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.