Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,250 --> 00:00:04,800
So we had a look at error messages,
2
00:00:04,800 --> 00:00:06,810
that we shouldn't panic when we read them,
3
00:00:06,810 --> 00:00:09,530
we had a look at other approaches we can take,
4
00:00:09,530 --> 00:00:11,240
to find and fix errors.
5
00:00:11,240 --> 00:00:14,200
And we had a look at the browser developer tools.
6
00:00:14,200 --> 00:00:17,830
Now, let's have a look at a dedicated tool,
7
00:00:17,830 --> 00:00:19,980
which is available for React Development,
8
00:00:19,980 --> 00:00:22,790
which can help us with React specific problems
9
00:00:22,790 --> 00:00:24,890
and which can help us with understanding
10
00:00:24,890 --> 00:00:27,470
our React Application better.
11
00:00:27,470 --> 00:00:29,819
And that would be the React Dev Tools.
12
00:00:29,819 --> 00:00:32,830
You can simply search for React Dev Tools
13
00:00:32,830 --> 00:00:34,540
and you should find an entry here
14
00:00:34,540 --> 00:00:36,970
on chrome.google.com.
15
00:00:36,970 --> 00:00:39,500
They are also available for Firefox,
16
00:00:39,500 --> 00:00:40,900
but I would strongly recommend
17
00:00:40,900 --> 00:00:42,770
that you use Google Chrome, if you wanna
18
00:00:42,770 --> 00:00:45,390
work with them, because they're a browser extension,
19
00:00:45,390 --> 00:00:47,530
which you can add to the browser.
20
00:00:47,530 --> 00:00:50,550
Now, I already did add them, but you can add them
21
00:00:50,550 --> 00:00:52,250
here with a simple add button,
22
00:00:52,250 --> 00:00:54,920
in case you didn't add them to your browser yet.
23
00:00:54,920 --> 00:00:57,370
So you'll simply visit that page here,
24
00:00:57,370 --> 00:01:00,500
in the Chrome Extensions Store.
25
00:01:00,500 --> 00:01:03,640
Though, these tools, this extension is totally free.
26
00:01:03,640 --> 00:01:05,030
You don't need to pay, no worries.
27
00:01:05,030 --> 00:01:07,511
And you simply add it to your browser.
28
00:01:07,511 --> 00:01:09,700
You might be prompted to restart
29
00:01:09,700 --> 00:01:11,999
your browser thereafter, but once you added them
30
00:01:11,999 --> 00:01:14,290
here in your browser dev tools,
31
00:01:14,290 --> 00:01:16,530
you'll have two new tabs.
32
00:01:16,530 --> 00:01:18,753
Components and Profiler.
33
00:01:20,030 --> 00:01:21,799
Now we'll have a look at the Profiler
34
00:01:21,799 --> 00:01:24,400
later in the course.
35
00:01:24,400 --> 00:01:26,840
For now, let's focus on Components.
36
00:01:26,840 --> 00:01:29,530
If you click on it, we see
37
00:01:29,530 --> 00:01:33,130
a little Component tree here, on the right.
38
00:01:33,130 --> 00:01:35,330
And that is what we're building with React right?
39
00:01:35,330 --> 00:01:37,170
We're building a tree of Components.
40
00:01:37,170 --> 00:01:39,223
So, it makes sense that we see that here.
41
00:01:39,223 --> 00:01:40,960
And what's interesting here is,
42
00:01:40,960 --> 00:01:44,561
that here we only see React Components.
43
00:01:44,561 --> 00:01:47,390
Now in the browser, we got the elements tab.
44
00:01:47,390 --> 00:01:49,460
And there we see the entire DOM,
45
00:01:49,460 --> 00:01:51,870
as it was rendered by the browser.
46
00:01:51,870 --> 00:01:53,790
And in the end, that's just a DOM,
47
00:01:53,790 --> 00:01:56,000
that is implied by our Components.
48
00:01:56,000 --> 00:01:57,450
So that can also be useful for
49
00:01:57,450 --> 00:01:59,293
debugging our DOM and our UI.
50
00:02:00,149 --> 00:02:03,050
But the difference to the Components tab here,
51
00:02:03,050 --> 00:02:04,850
is that in the Components tab,
52
00:02:04,850 --> 00:02:07,320
we see the actual React Components
53
00:02:07,320 --> 00:02:08,970
and the Components structure,
54
00:02:08,970 --> 00:02:11,779
that is responsible for this UI output.
55
00:02:11,779 --> 00:02:13,720
And we see, for example, that we have
56
00:02:13,720 --> 00:02:15,310
that root App Component.
57
00:02:15,310 --> 00:02:17,790
And it's even getting highlighted on the left,
58
00:02:17,790 --> 00:02:19,280
with the CourseInput Component,
59
00:02:19,280 --> 00:02:21,000
which has the Button Component.
60
00:02:21,000 --> 00:02:22,430
With the CourseGoalList Component,
61
00:02:22,430 --> 00:02:24,840
with the different CourseGoalItems.
62
00:02:24,840 --> 00:02:26,660
We can also click on those Components,
63
00:02:26,660 --> 00:02:29,040
to get more information about them.
64
00:02:29,040 --> 00:02:30,650
Here, for example, we already see that
65
00:02:30,650 --> 00:02:32,639
a key is set, but then if we scroll down
66
00:02:32,639 --> 00:02:35,410
for the CourseGoalItem, we actually see
67
00:02:35,410 --> 00:02:38,252
a list of all props that it's getting.
68
00:02:38,252 --> 00:02:40,570
That includes the children prop,
69
00:02:40,570 --> 00:02:42,050
so the content passed between
70
00:02:42,050 --> 00:02:43,770
the opening and closing tag,
71
00:02:43,770 --> 00:02:48,090
the ID prop, the onDelete prop and this new prop,
72
00:02:48,090 --> 00:02:49,820
which we can ignore.
73
00:02:49,820 --> 00:02:51,970
For the onDelete prop, we for example,
74
00:02:51,970 --> 00:02:54,390
see that the deleteItemHandler function,
75
00:02:54,390 --> 00:02:56,210
is passed as a value.
76
00:02:56,210 --> 00:02:59,225
For children, we see that it's the text of the task.
77
00:02:59,225 --> 00:03:00,940
And if we scroll down further,
78
00:03:00,940 --> 00:03:03,290
we see which Components were responsible
79
00:03:03,290 --> 00:03:04,790
for rendering this.
80
00:03:04,790 --> 00:03:06,773
And these Components are ordered,
81
00:03:06,773 --> 00:03:08,930
depending on how close they are.
82
00:03:08,930 --> 00:03:10,803
The top most Component here, is the Component
83
00:03:10,803 --> 00:03:13,657
which directly rendered CourseGoalItem.
84
00:03:13,657 --> 00:03:15,780
And the further down we go here,
85
00:03:15,780 --> 00:03:17,830
the further away that Component is,
86
00:03:17,830 --> 00:03:19,870
in the main Component tree.
87
00:03:19,870 --> 00:03:22,310
Indeed CourseGoalList Component did render
88
00:03:22,310 --> 00:03:24,530
the two CourseGoalItems, but of course
89
00:03:24,530 --> 00:03:27,350
CourseGoalList then was rendered by App,
90
00:03:27,350 --> 00:03:29,250
Which is why we see that here as well.
91
00:03:30,130 --> 00:03:32,430
We also see the source code, where we can find
92
00:03:32,430 --> 00:03:34,590
information about the CourseGoalItem.
93
00:03:34,590 --> 00:03:36,380
And if we click on CourseGoalList here,
94
00:03:36,380 --> 00:03:38,720
for example, we're taken to that Component.
95
00:03:38,720 --> 00:03:40,755
Of course, we could have also clicked on it here.
96
00:03:40,755 --> 00:03:43,443
You can also search for a Component here,
97
00:03:43,443 --> 00:03:46,900
like for item, to highlight them and find them quicker.
98
00:03:46,900 --> 00:03:49,210
And you can also configure what you see here.
99
00:03:49,210 --> 00:03:51,789
The general theme, light mode, dark mode,
100
00:03:51,789 --> 00:03:53,820
how it should be displayed.
101
00:03:53,820 --> 00:03:55,280
And in general, you can play around
102
00:03:55,280 --> 00:03:57,280
with the settings here, to for example,
103
00:03:57,280 --> 00:03:59,880
display more information, less information,
104
00:03:59,880 --> 00:04:02,220
or simply in a different style.
105
00:04:02,220 --> 00:04:05,303
I prefer that style and therefore I'll keep it this way.
106
00:04:06,360 --> 00:04:08,490
Now, what you'll also see, is that if you,
107
00:04:08,490 --> 00:04:10,910
for example, go to the CourseInput,
108
00:04:10,910 --> 00:04:12,820
you don't just see the props there,
109
00:04:12,820 --> 00:04:14,140
but you also see the hooks
110
00:04:14,140 --> 00:04:15,350
that are being used here.
111
00:04:15,350 --> 00:04:16,560
And you see that in there,
112
00:04:16,560 --> 00:04:19,480
we're using cue State hooks.
113
00:04:19,480 --> 00:04:23,560
Remember that I mentioned that useState,
114
00:04:23,560 --> 00:04:27,090
which we use to manage State is a so-called React hook.
115
00:04:27,090 --> 00:04:30,280
And later, we'll learn about other hooks as well.
116
00:04:30,280 --> 00:04:32,480
So this is a so-called React hook
117
00:04:32,480 --> 00:04:34,000
and that's why it's showing up under
118
00:04:34,000 --> 00:04:35,770
this hooks section here.
119
00:04:35,770 --> 00:04:37,690
It's a State hook, which is responsible
120
00:04:37,690 --> 00:04:39,850
for managing the State of course input.
121
00:04:39,850 --> 00:04:42,838
And here we can see and actually also change
122
00:04:42,838 --> 00:04:44,584
the current State.
123
00:04:44,584 --> 00:04:48,910
For example, here, if I enter Master React,
124
00:04:48,910 --> 00:04:50,780
you'll see that's reflected down there.
125
00:04:50,780 --> 00:04:52,611
And if I add an exclamation mark here,
126
00:04:52,611 --> 00:04:54,670
it's not reflected in the input,
127
00:04:54,670 --> 00:04:57,900
because in our code, we're actually not feeding
128
00:04:57,900 --> 00:05:00,150
the current value back into the input.
129
00:05:00,150 --> 00:05:02,800
We could do that, by setting the value prop,
130
00:05:02,800 --> 00:05:04,760
but we're not doing that here.
131
00:05:04,760 --> 00:05:06,900
But nonetheless, if I now add the goal,
132
00:05:06,900 --> 00:05:08,252
you see that the exclamation mark
133
00:05:08,252 --> 00:05:11,600
is part of the text that was added here,
134
00:05:11,600 --> 00:05:12,513
here it is.
135
00:05:13,770 --> 00:05:15,990
Or here it was, since I clicked on it.
136
00:05:15,990 --> 00:05:17,910
So we can change the State here.
137
00:05:17,910 --> 00:05:20,633
And it really will have an effect on the UI.
138
00:05:21,720 --> 00:05:23,570
On the App Component, we, for example,
139
00:05:23,570 --> 00:05:25,240
see our array of Goals.
140
00:05:25,240 --> 00:05:27,370
And if I change one of the Goals here,
141
00:05:27,370 --> 00:05:29,270
if I change the text here, by adding
142
00:05:29,270 --> 00:05:32,020
multiple exclamation marks, that is reflected here
143
00:05:32,020 --> 00:05:33,830
on the left as well.
144
00:05:33,830 --> 00:05:35,877
So that's another great tool for playing around
145
00:05:35,877 --> 00:05:38,300
with your interface, with your State,
146
00:05:38,300 --> 00:05:40,077
with your props and for understanding
147
00:05:40,077 --> 00:05:42,660
how everything is connected and also
148
00:05:42,660 --> 00:05:44,530
for trying out different use cases,
149
00:05:44,530 --> 00:05:46,370
in different scenarios.
150
00:05:46,370 --> 00:05:48,450
So that's the last tool I want to show you
151
00:05:48,450 --> 00:05:51,100
in this module, because the React Dev Tools
152
00:05:51,100 --> 00:05:52,732
can also be really useful,
153
00:05:52,732 --> 00:05:54,510
when it comes to debugging
154
00:05:54,510 --> 00:05:57,093
and analyzing your React Application.
11650
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.