Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,270 --> 00:00:04,560
Now this project, which was created for us
2
00:00:04,560 --> 00:00:07,540
has a couple of starting files which we don't need here
3
00:00:07,540 --> 00:00:09,861
for example, a file for automated tests
4
00:00:09,861 --> 00:00:11,610
that is something which I covered
5
00:00:11,610 --> 00:00:14,870
in my complete guide course but we don't need it here.
6
00:00:14,870 --> 00:00:18,274
So, I'll get rid of that file and also of the logo.svg,
7
00:00:18,274 --> 00:00:22,300
reportWebVitals.js, setupTests.js and App.css.
8
00:00:22,300 --> 00:00:25,200
If you got more files you can get rid of those as well
9
00:00:25,200 --> 00:00:28,440
you should be left with an index.js, App.js
10
00:00:28,440 --> 00:00:30,853
and the index.css file thereafter.
11
00:00:31,930 --> 00:00:35,620
Now in index.js I will get rid of that
12
00:00:35,620 --> 00:00:40,620
import of reportWebVitals and I'll explain these imports
13
00:00:40,700 --> 00:00:42,370
in greater detail in a second
14
00:00:42,370 --> 00:00:45,140
for the moment let's just focus on cleaning up
15
00:00:45,140 --> 00:00:47,150
and I'll get rid of that code down there
16
00:00:47,150 --> 00:00:50,930
and I'll get rid of React.StrictMode because for the moment
17
00:00:50,930 --> 00:00:52,660
for getting started it is simpler
18
00:00:52,660 --> 00:00:54,453
if we just get started like this.
19
00:00:55,340 --> 00:00:58,760
In index.css I'll get rid of all that code as well
20
00:00:58,760 --> 00:01:01,820
we're going to add different CSS code soon.
21
00:01:01,820 --> 00:01:04,680
And then App.js they're all getting rid of
22
00:01:04,680 --> 00:01:06,750
these two imports at the top
23
00:01:06,750 --> 00:01:10,870
and then of all the content here in this return statement
24
00:01:10,870 --> 00:01:12,920
all this HTML code.
25
00:01:12,920 --> 00:01:16,420
For the moment, we can just add a simple div here
26
00:01:16,420 --> 00:01:17,883
where we say hello.
27
00:01:19,350 --> 00:01:22,050
Now we can save that and that's now the starting set up
28
00:01:22,050 --> 00:01:24,210
with which I wanna get started.
29
00:01:24,210 --> 00:01:28,140
You'll also find this starting project snapshot attached
30
00:01:28,140 --> 00:01:31,480
to this video so that you can also download it from there
31
00:01:31,480 --> 00:01:33,470
and get started with that.
32
00:01:33,470 --> 00:01:36,460
If you do download my attached snapshot though,
33
00:01:36,460 --> 00:01:39,550
there's one important step you must not miss
34
00:01:39,550 --> 00:01:41,180
and you have to go through.
35
00:01:41,180 --> 00:01:45,400
You have to install third party dependencies of this project
36
00:01:45,400 --> 00:01:49,400
because since it is a bit of a more complex project setup
37
00:01:49,400 --> 00:01:53,119
working with third party packages like the React project
38
00:01:53,119 --> 00:01:56,000
works a little bit differently here.
39
00:01:56,000 --> 00:01:58,070
We got this package.json file
40
00:01:58,070 --> 00:02:01,637
which lists all the dependencies of this project.
41
00:02:01,637 --> 00:02:04,538
And there we for example, see the React library
42
00:02:04,538 --> 00:02:08,013
and another package which is part of the react library
43
00:02:08,013 --> 00:02:11,970
which are listed as dependencies.
44
00:02:11,970 --> 00:02:13,820
Now, these dependencies are managed
45
00:02:13,820 --> 00:02:17,900
and installed automatically for us and the big code bundle
46
00:02:17,900 --> 00:02:21,570
with our code and that third-party library code
47
00:02:21,570 --> 00:02:24,870
will be generated automatically behind the scenes
48
00:02:24,870 --> 00:02:29,410
by those build steps which exist in this project as well
49
00:02:29,410 --> 00:02:32,860
those are brought in by that react-scripts package.
50
00:02:32,860 --> 00:02:36,020
Now I am aware that this silence fairly overwhelming
51
00:02:36,020 --> 00:02:37,540
and complex right now,
52
00:02:37,540 --> 00:02:39,200
especially if you've never worked
53
00:02:39,200 --> 00:02:41,360
with anything like React before
54
00:02:41,360 --> 00:02:44,040
and you're used to standard setups
55
00:02:44,040 --> 00:02:45,770
where you have an HTML file
56
00:02:45,770 --> 00:02:47,950
and a bunch of JavaScript imports
57
00:02:47,950 --> 00:02:50,940
but we can ignore all of that for the moment.
58
00:02:50,940 --> 00:02:52,852
We just add dependencies here
59
00:02:52,852 --> 00:02:57,380
and we can then import them into our JavaScript files
60
00:02:57,380 --> 00:02:59,210
that's what you see here with those
61
00:02:59,210 --> 00:03:01,320
strange import statements
62
00:03:01,320 --> 00:03:03,260
and then this build step
63
00:03:03,260 --> 00:03:06,510
which is part of this project set up which is started
64
00:03:06,510 --> 00:03:09,620
when we run one of these scripts like npm start
65
00:03:09,620 --> 00:03:11,018
which we did before.
66
00:03:11,018 --> 00:03:14,560
These scripts will then in the end combine
67
00:03:14,560 --> 00:03:17,290
and transform all the code and combine
68
00:03:17,290 --> 00:03:19,660
the third party package code with our code
69
00:03:19,660 --> 00:03:22,310
and make sure that the result is an output
70
00:03:22,310 --> 00:03:24,620
which the browser understands.
71
00:03:24,620 --> 00:03:26,940
Now, because we have that setup,
72
00:03:26,940 --> 00:03:28,597
if you download my attachment
73
00:03:28,597 --> 00:03:31,020
you need to run one extra command
74
00:03:31,020 --> 00:03:33,690
before everything here will work for you.
75
00:03:33,690 --> 00:03:36,710
And for this it's best if you open the terminal
76
00:03:36,710 --> 00:03:39,150
or command prompt which is integrated
77
00:03:39,150 --> 00:03:43,160
into Visual Studio Code with new terminal
78
00:03:43,160 --> 00:03:46,350
which is your standard operating system terminal
79
00:03:46,350 --> 00:03:50,860
or command prompt just already integrated into this IDE
80
00:03:51,930 --> 00:03:53,810
and any commands we run here
81
00:03:53,810 --> 00:03:57,620
are then automatically executed in this project folder.
82
00:03:57,620 --> 00:04:00,617
And here you need to run the npm install command
83
00:04:00,617 --> 00:04:03,610
which will simply download all those dependencies
84
00:04:03,610 --> 00:04:07,870
this project has and store them in this node_modules folder
85
00:04:07,870 --> 00:04:09,200
which we have here.
86
00:04:09,200 --> 00:04:12,380
That's a folder in which we will never work
87
00:04:12,380 --> 00:04:16,279
because that holds all these third party dependencies
88
00:04:16,279 --> 00:04:20,430
and they are dependencies which our project needs.
89
00:04:20,430 --> 00:04:22,320
So, that's a folder which is here
90
00:04:22,320 --> 00:04:24,820
but which was not part of the attached code
91
00:04:24,820 --> 00:04:26,622
because it's a fairly large folder
92
00:04:26,622 --> 00:04:30,010
and hence the attachment would be unnecessarily big
93
00:04:30,010 --> 00:04:33,980
and you can simply recreate it by running npm install
94
00:04:33,980 --> 00:04:38,260
in that folder that has this package.json file
95
00:04:38,260 --> 00:04:40,300
so that's why we need to do that then.
96
00:04:40,300 --> 00:04:42,620
And there after you can run npm start again
97
00:04:42,620 --> 00:04:44,741
to bring up that's development server.
98
00:04:44,741 --> 00:04:48,120
And I will do that here again and for this I'll go to the
99
00:04:48,120 --> 00:04:51,193
Albert terminal where I run it npm start before
100
00:04:51,193 --> 00:04:55,200
and I'll quit this process with controlled C now.
101
00:04:55,200 --> 00:04:58,210
Now, as long as you don't quit that process
102
00:04:58,210 --> 00:05:00,650
the development server is up and running
103
00:05:00,650 --> 00:05:02,550
and listening to code changes
104
00:05:02,550 --> 00:05:04,960
to then displayed them in the browser.
105
00:05:04,960 --> 00:05:07,700
You can quit this server whenever you're done
106
00:05:07,700 --> 00:05:11,120
with development for today and then you simply restart it
107
00:05:11,120 --> 00:05:14,830
with npm start again if you wanna pick up development again
108
00:05:14,830 --> 00:05:18,277
but now I'm not restarting it in this standalone terminal
109
00:05:18,277 --> 00:05:20,818
but instead in this integrated terminal
110
00:05:20,818 --> 00:05:24,190
which has already navigated into my project folder
111
00:05:24,190 --> 00:05:26,290
and the advantage of starting it here
112
00:05:26,290 --> 00:05:29,930
is that I will always immediately see any errors
113
00:05:29,930 --> 00:05:34,430
that might occur if I have an error in my code for example.
114
00:05:34,430 --> 00:05:38,231
And that's well started here zoom out a bit
115
00:05:38,231 --> 00:05:41,500
make this a bit smaller and keep that up and running
116
00:05:41,500 --> 00:05:43,260
as long as I'm developing.
117
00:05:43,260 --> 00:05:46,940
So don't close the terminal, don't run control C here,
118
00:05:46,940 --> 00:05:48,920
keep it up and running.
119
00:05:48,920 --> 00:05:52,430
And if you do that and you go back to localhost 3000
120
00:05:52,430 --> 00:05:55,630
and reload, you should just see hello there
121
00:05:55,630 --> 00:05:58,760
because of our cleanup process.
122
00:05:58,760 --> 00:06:01,230
Now that was a lot of work just to get started
123
00:06:01,230 --> 00:06:04,520
but I am a big fan of having a clean start
124
00:06:04,520 --> 00:06:06,760
and explaining what's going on here
125
00:06:06,760 --> 00:06:09,310
instead of just throwing code at you
126
00:06:09,310 --> 00:06:12,460
and leaving it up to you to figure out what's happening.
127
00:06:12,460 --> 00:06:14,540
That's the project set up we're dealing with
128
00:06:14,540 --> 00:06:17,650
that's my ID and that's the cleaned up project
129
00:06:17,650 --> 00:06:19,170
which you all to find attached.
130
00:06:19,170 --> 00:06:22,340
and therefore now, let's start writing our own code
131
00:06:22,340 --> 00:06:25,950
and let's understand these different React features
132
00:06:25,950 --> 00:06:29,083
and this strange syntax here step-by-step.
10789
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.