#14: React JS Projects: How to Deal with Errors and Warnings - 3 Best Practices🔥

Thapa Technical
63 followers
1 Video View·Jun 10, 2024
Hello what's up guys my name is Vinod
Bahadur Thapa and today in this video we will see how to
tackle errors in our react
project yes guys so today's video is
very important
because I will tell you how to tackle the errors
or warnings. You can tackle it
in your React project, it's fine, but before that, if you have not
checked out the previous videos till now, then definitely check them out
because it is very important and
we are
adding CSS to it from Netflix's basically and yesterday's video. We will start but
before that there is a problem here and that
is that you must have seen through out this series, you
know us in a way, I mean this wave of red color, you must have seen
this type of wave at the It is visible at the bottom
whereas there is
no problem anywhere else, there is no error, there is
no problem, but still we are getting
these red waves which is
irritating us guys, at the moment it
seems very less. But earlier it
was very much, it is okay, so here I
will tell you how you can tackle it,
first of all look, first of all,
look carefully, you just focus on it, what do you have to do,
empty everything is to be done here.
This is telling that the particular toad image is
missing in props validation The validation of props is telling that
this is missing Okay,
first of all about lint here, by
default here, they have
given their own quick fix on this.
If you click, there are three options here, do you
want to disable, you mean you
can do it basically for this particular line, or
you can disable the entry file, let's try
with this one, see the moment, I have done it,
it is your work. It is completely gone, but this
particular part is
not disabled, now I go here, okay, this
one of the particular part is visible, it is
visible because
I have deconstructed the ID, but this ID.
I am not using it anywhere, so
it is natural that it is visible to you.
Well for now, no one has declared it
but its value is
never used. On the other hand, if you
look at this particular portion. So here also I am
getting the same warning that data is
missing in props validation and quick
fix. If I go to the page then again the same
thing is getting to me. Once I go to the
documentation, what does it say?
All right. Basically, it opened at that place, so
you can see that guys react,
there are props under there are some types, this is a
rule, now this allows missing props
validation in this, it is okay in this way, so it is visible to
you, something like this. Okay,
you will have to read this, you will have to understand
what it is and what it is not, what are its
values, Enable Ignore, all that is fine, so that's it,
defining types of
component props, improve reusability
of your components by validating received
data, see today's At the time everyone says that now instead
of using type
script because there is type checking in it
and many other things that happen and by the
way
a I know must be coming in your mind that brother
tells in the type script then Yes
but no one, I will show you here we
have these courses and I have already
uploaded the complete course on type script,
so now definitely check it out,
you will get all the videos here, source
code files, so here you can see yourself.
You can find everything here, the complete
type script is here guys, you
must check it out. Okay, right and
I will tell you one more thing, this is
one method, another method, I will
tell you one more. Go here and copy the error that is coming
because now we are not so old
that we can know what the error is as soon as we see it. If you are
understanding this for the first time then
we will have to see what
they have done here
once. You got this talk flow, however, you
can use GPT here, you can see
and let's see and disable the
project wide awesome, if you
enjoyed it, let's do this part where
you can click on your Slint file.
Okay, look how I got it here,
I will go where I said, this is the
particular file which we get by default,
I clicked and here the
rules, I am getting some here we have
one rules look na react han Props I
mean
f prop different types, you have to turn it off,
I copied and
pasted this, you have to put a comma,
props basically Jason, I think it's fine,
okay, so I did this, it
means that now all our props The
type of checking is not going to be
simple, meaning no error will come
and here one more thing is given as no
target blank, this is a special line,
it means that whenever you go to target at
first blank I guess I am here. Have you done it
somewhere or here we have this
part, if you write this then remember we
have one more edible, if you ever see then the
rail which has no opener inside it remains in this manner
and one more no referral and one If the value is
there, even if you don't write that,
it will work for you. Look carefully, if
I had commented on it, look here, you got an
error, what is it telling you, using
target itna without a rail no referrer and
implicit rail no. Opener is a real risk in
older browsers. You are watching by default.
Now, that's why I have
this way here, so you can see how it
is connected to each other, so I
am going back to uncommenting it, so that's my The
warning will go away by default,
it is being ignored but the good thing is
that if you use Rails here then it will be better
and for the time being, this was our
particular error, for that now I do
n't even need it. Look, I am not getting it,
neither is it coming on the data nor it is coming here,
everything is fine, just because
we had to disable or turn off the part of the particular type checking part,
so this is it today. That's all for this video
and this trick which I have told you will be
useful to you everywhere. Tomorrow if you make
any mistake here then you
can use it there. If you understand then there are
many places where guys you simply make an error.
Try copy and pasting it on Google2 wherever you
find it and you will find it somewhere and by the way, this is already the
boss react's community, it's a
community, so you can assume that the
error you are facing right now will be useful to people
five years from now. Maybe it might have already come
and he told the complete solution
that if it comes then you
can correct it in this way so or this is it today this
video so much hope you must have liked the video very much
how did you like the video Let
me know in the comment section. If there is any other error
which you are not getting then let me know in the
comment section. If you like the video then please like it and
share it with your friends and
I will be very happy if you subscribe
because it helps I will
get motivation to help my channel so please subscribe, I will
meet you in the next video till then
guys thank you so much take
care
[Music]
