Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,300 --> 00:00:06,540
Now, let's take a look at what create react app has made for us, so we're going to go into our monster's
2
00:00:06,540 --> 00:00:07,200
Rolodex.
3
00:00:08,560 --> 00:00:14,770
And if we hit El's, we see that it's actually generated this project for us, it's got all our dependencies
4
00:00:14,770 --> 00:00:20,030
inside of node modules and it's got a package, JSON and then some of these other folders and files.
5
00:00:20,770 --> 00:00:22,120
So now if we open that up.
6
00:00:23,010 --> 00:00:26,550
And take a look, let's look at the package, Jason, first.
7
00:00:27,460 --> 00:00:33,100
We see that it's included for us react and react, Dom, which is great, as well as this other library
8
00:00:33,100 --> 00:00:34,210
called Riak Scripts.
9
00:00:35,150 --> 00:00:42,530
Now, what Riak Scripts does for us is it's what makes create react so great, it's actually what allows
10
00:00:42,530 --> 00:00:45,800
us to have to not worry about web pack and babble.
11
00:00:47,280 --> 00:00:53,370
It includes these four scripts for us, and it calls that library reac scripts to do these four things
12
00:00:53,730 --> 00:00:56,980
start, build, test and eject.
13
00:00:57,570 --> 00:01:01,550
Now, what START does is it actually starts the project.
14
00:01:01,590 --> 00:01:02,820
So let's try that first.
15
00:01:04,129 --> 00:01:05,420
So if we call yarn start.
16
00:01:06,820 --> 00:01:15,190
Riak scripts start right there, and what this does is it serves up this sample application of react
17
00:01:15,190 --> 00:01:17,750
inside of our localhost, which is pretty awesome.
18
00:01:17,770 --> 00:01:22,710
We have a working react app right away if we look at the next one built.
19
00:01:23,470 --> 00:01:27,550
So before we start looking at the script, let's actually look at these two folders.
20
00:01:28,030 --> 00:01:32,410
Now, the source folder is actually where our application lives.
21
00:01:32,440 --> 00:01:37,980
All of the area code that we write for our application is going to go into the source folder.
22
00:01:38,770 --> 00:01:46,630
This public folder is actually where all those files that I mentioned earlier, where our browser needs
23
00:01:46,630 --> 00:01:52,930
an older version of JavaScript in HTML to understand so well, this is actually the folder where all
24
00:01:52,930 --> 00:01:53,680
that's going to go.
25
00:01:54,070 --> 00:02:01,360
So when we call this build script, what create racked up is going to do is it's going to turn all of
26
00:02:01,390 --> 00:02:07,510
the area code in our source folder into that version that the browser understands and put it inside
27
00:02:07,510 --> 00:02:08,500
of this public folder.
28
00:02:09,490 --> 00:02:12,280
Tests just runs the test code that we're going to write.
29
00:02:13,290 --> 00:02:21,450
And then eject will actually take out all of the configuration files that it's hidden from us for babble
30
00:02:21,450 --> 00:02:24,240
and in case we wanted to manage it ourselves.
31
00:02:25,880 --> 00:02:32,630
Now, now that we understand what the basics of what create react has done for us here, let's actually
32
00:02:32,630 --> 00:02:33,700
look at some of the code.
33
00:02:34,640 --> 00:02:38,670
Now, the first thing I want us to look at is this after James file.
34
00:02:39,270 --> 00:02:43,700
Now, I know this looks a little overwhelming, but let's just take it line by line.
35
00:02:44,600 --> 00:02:49,130
So first, we're going to import all the things from react that we need.
36
00:02:49,760 --> 00:02:51,080
And it's called react, right?
37
00:02:51,090 --> 00:02:53,030
We import, react from react.
38
00:02:53,030 --> 00:02:57,830
And that's going to hold everything related to react that we need inside of into this file.
39
00:02:59,140 --> 00:03:07,180
Then we're going to import the logo from Logo SVG, which is essentially just this logo image.
40
00:03:08,880 --> 00:03:11,160
Then we're going to import the excess.
41
00:03:12,200 --> 00:03:16,340
And now let's look at the actual meat of this vile.
42
00:03:17,630 --> 00:03:18,720
Let's look at line five.
43
00:03:19,580 --> 00:03:23,960
This is just a function called app that returns a block of HTML.
44
00:03:24,290 --> 00:03:25,340
That's all it is.
45
00:03:26,150 --> 00:03:31,670
So everything that we see here is actually just the HTML here.
46
00:03:32,800 --> 00:03:38,050
Now, how this works is that when we look at this index, such as file.
47
00:03:39,020 --> 00:03:45,540
We see that we import that app function that we were just looking at and then there's this react dom
48
00:03:45,590 --> 00:03:53,570
library that calls render and then it renders our app function in the form of what looks like an HTML
49
00:03:53,570 --> 00:03:53,990
tag.
50
00:03:54,380 --> 00:03:54,740
Right.
51
00:03:55,310 --> 00:03:59,850
And then you see this thing here that says document element by ID of root.
52
00:04:00,560 --> 00:04:09,680
So what this is, is it's looking on the document object for some elements with an idea of root, and
53
00:04:09,680 --> 00:04:15,030
it's replacing it with this function that we saw that returns HTML.
54
00:04:15,680 --> 00:04:20,570
So it's going to replace that element with the idea of root with all of that HTML from our function.
55
00:04:21,500 --> 00:04:30,530
And where that Divx is with the idea of it is inside of index ideational, inside of this body tag is
56
00:04:30,530 --> 00:04:32,810
a single div with the idea of root.
57
00:04:34,060 --> 00:04:43,300
And this is the entry way for our application, it's essentially just this library replacing that div
58
00:04:43,300 --> 00:04:49,300
with the idea of it with our function that returns some HTML.
59
00:04:50,710 --> 00:04:59,920
Now, one of the great things about Create React app is that if we make any changes to any of our files,
60
00:05:00,460 --> 00:05:04,260
it'll automatically update inside of our localhost.
61
00:05:04,510 --> 00:05:09,520
So if I wanted to change this to say hello, my name is EOWA.
62
00:05:11,240 --> 00:05:16,040
We will automatically see this update, and that's really awesome, because that means that we don't
63
00:05:16,040 --> 00:05:18,050
have to worry about refreshing anything.
64
00:05:18,290 --> 00:05:21,050
We just code and see those changes like.
65
00:05:22,110 --> 00:05:27,060
Now, let's get started with actually converting this into this.
6491
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.