Check out our React playlist for more React tutorials: kzbin.info/aero/PLWKjhJtqVAbkArDMazoARtNz1aMwNWmvC
@Gigatless4 жыл бұрын
It's great to see someone who actually used a thing so they can explain the things you would actually need in real world.
@TricoliciSerghei6 жыл бұрын
Masterpiece example of component lifecycle! Great explanation!
@fytubevw4 жыл бұрын
Super clarity. Very calm and concise style, which makes the video easy to ingest.
@waltervenditti31742 жыл бұрын
Yeah seriously. So sick of all the "wacky" programming videos filled with terrible jokes.
@harunguven85813 жыл бұрын
I come from The Odin Project and find this video useful! Especially for beginners. By the way how is your Odin Project adventure going? You guys must come very close to end of Javascript course. I
@byslyrten3 жыл бұрын
Yes, it looks like we are getting kind of intermediate-advanced topics right now and I am really grateful to people who contribute this great curriculum that gets me from absolute beginner level to be able to create somewhat good level web apps.
@Fooljuice3 жыл бұрын
Good to see another Odin Project member here! We're almost at the end, let us finish strong!
@adarshtiwari73953 жыл бұрын
Hey fellow odin warrior😃
@othmaneelkantaoui96742 жыл бұрын
i wish the odin project gave us more videos like this instead of lengthy articles
@sarvarkhalimov1113 жыл бұрын
Amazing tutorial to grasp concepts and where/how to use lifecycle methods. Thanks for this tutorial!
@michaelhashimoto1650 Жыл бұрын
I like class components more than functional components. It feels like you have more control.
@VigneshSharma-vrs6 жыл бұрын
11:50 while explaining shouldComponentUpdate, if the currentProp which is this.props.ignoreProp is not same as nextProps meaning that the prop has changed, we request for render and update. I'm little confused here, cos your code does the opposite of what I'm thinking. Please clarify.
@voyageruk20026 жыл бұрын
I think it should not update if the props are === rather than !==
@deepakbisht62156 жыл бұрын
bro because the props have been updated the ignoreProp button have changed the state ignoreProp and hence the prop for the counter component using Math.random() function it would not update the componet ie return false ps - if it would be a case when math.random() generates same number twice then shouldComponentUpdate would have returned true and updated the component hope you understand
@PraveenKumar-lp6il3 жыл бұрын
add props as param in error component..otherwise compile time issue will happen in new version React
@illb2fast4u6 жыл бұрын
Dude, this is so cool. I'm only learning JavaScript now. Just finished Vanilla JS, next up React.
@clashwithcmad3 жыл бұрын
It's been 3 year What going on?
@martinwest72502 жыл бұрын
you finished vanilla js???
@Sandeep-zu7gd Жыл бұрын
almost 5 years are you a react master senpai now?
@abhilashpoojary38124 жыл бұрын
Great examples with neat explanation 😍
@ristolibera12953 жыл бұрын
What an excellent tutorial!
@NotTheLastOne6 жыл бұрын
18:43 you dont have the variable error in your state but you referring to this variable and it seems to be working. how does it work? it seems my react is not the same with your react thought I have the latest version
@nickkarnik96884 жыл бұрын
TheLastOne thanks for pointing that out. No idea how I missed that! It works because it is treated as any other method. It isn’t called.
@danieldejager18472 жыл бұрын
Excellent tutorial , its pragmatic and to the point. Thank you.
@anant1995rawat19953 жыл бұрын
Amazing Bro!!!!!!. Best explaination ever
@leonzchang87903 жыл бұрын
thanks for the awesome video. I use create-react-app to run the code ,wondering why componentDidCatch won't show parent component but showing error
@lennygith62543 жыл бұрын
I also did that and got similar results. If you can please update the comment when you find an error. I'll do the same too.
@DrDemolition3 жыл бұрын
@@lennygith6254 It's an overlay, you can press the x on top right and get the actual render.
@ANANDSHARMA-ws2xf4 жыл бұрын
You explained amazing ways 👍
@mohamedreejan81434 жыл бұрын
Clear explanations,, very useful.. thanku👍
@reynaoldman91003 жыл бұрын
Thanks, this video was very helpful for me.
@m.a61413 жыл бұрын
Perfect Tutorial
@RafaelSFTech6 жыл бұрын
Is a good pratice using methods in constructor? i think is not
@jaredgiangrasso59655 жыл бұрын
I think he's defining his methods in the constructor to avoid having to bind them to 'this' in the constructor. Although I'm not sure why he doesn't just use arrow functions outside of the constructor instead which should accomplish the same thing.
@jamshyek3 жыл бұрын
Nice explanation
@sulistyoardani73144 жыл бұрын
where ignoreCase comes from? minute 09:02
@adrielamadi85853 жыл бұрын
im actually watching this now even though it was uploaded 3 years ago.. still very useful
@natashakanji33134 жыл бұрын
you made my day thanks
@karangupta7254 жыл бұрын
why we want to render even if ignore prop is same as before at around 10:59?
@sagemode374 жыл бұрын
We are not rendering if it is same. return false if the prop is same so it won't render
@BiscuitTech6 жыл бұрын
This was really useful, thanks!
@karangupta7254 жыл бұрын
at 13:02 why did he used parseInt , doesn't Math.random() returns integer value?
@sagemode374 жыл бұрын
Math.random() returns random floating point value between 0 and 1 , so we can get anything , for eg: 0.67589432 . If you multiply this by 100 --> 67.589432 . And parseInt(67.589432) will return 67 .
@mfarim6 жыл бұрын
Thanks. Good Explanation...
@rajbannasa76623 жыл бұрын
Thank you so much sir ❤️
@bharathsam43552 жыл бұрын
Good explaination
@VictorGarcia-si8wy6 жыл бұрын
You sound just like Beau Carnes lol. Thanks for the content!
@mohammedhasanshaikh48004 жыл бұрын
Really love your content..!!
@viditsharma39294 жыл бұрын
is it not better to use setState by passing it as a function and recording the previous value?
@matrixspielt3 жыл бұрын
Yup. Otherwise, the state could have already changed. For anyone who is wondering: this.setState(function(prevState, prevProps) {}).
@anandhegde93455 жыл бұрын
if getDerivedStateFromProps is used for setting the state from props why can't it be done in constructor? We have access to props in constructor as well.
@nickkarnik96884 жыл бұрын
Anand Hegde that will work only during object creation. If props were to change after that then the getDerivedStateFromProps hook is useful.
@CarlWicker5 жыл бұрын
Great video
@oskarolortegui96234 жыл бұрын
So cool, please help me with this. why do you use the methods without using the ".bind(this)" into the constructor? what's the difference between doing in that way from the other way?????
@artembelyshev94674 жыл бұрын
You can use both methods depends of your situation. Using of arrow functions with ES6 is equivalent of binding to constructor
@somasundaramb22813 жыл бұрын
Hi, I have a doubt on ShouldComponentUpdate method implementation. That is, if present value and future value are different , then it should re-render.right? But,here it is not re-render Can any guide me
@adrielamadi85853 жыл бұрын
exactly, it should only re-render or set to true if the present value and the future value are different and not when they are same
@berkekaancetinkaya87214 жыл бұрын
Shouldn't you have used the prevState parameter while incrementing the state.count value? this way you are editing the state directly its not the best practice, also in Docs using prevState parameter is the best practice
@prathameshausekar2 жыл бұрын
Thanks a ton!
@dhrunit10184 жыл бұрын
Thank you for this :)
@someone-on-earth8 ай бұрын
the functional approach with useEffect() and useState() would be easier imh
@harshavamsikalluri6 жыл бұрын
Thanks a lot!
@shaifuddin2 жыл бұрын
Please do a Mantine hooks project
@martinharrisFTW5 жыл бұрын
good stuff! thank you
@karangupta7254 жыл бұрын
is somebody even watching this old tutorial, other than me?
@adrielamadi85853 жыл бұрын
well... I'm watching it now lol
@lawrencemichael55713 жыл бұрын
Hey yo!
@keevnx5 жыл бұрын
What is the difference when I put the state inside constructor and state outside constructor, what is the difference?
@nickkarnik96884 жыл бұрын
Kevin Adam it’s the same. Within the constructor you have access to props.
@bilelrahmouni014 жыл бұрын
are you explaining or showing off how rapid you are on the keyboard?
@azelsky6 жыл бұрын
if we need to load up some data from a server, for example, we loaded articles and it contains some comments but data which we have contains the only id of comments. Based on it we need to make a request to receive comments. Do we make this request in ComponentDidUpdate? Because before I did it in componentWillReceiveProps but now it is legacy
@wilsongaturu1345 жыл бұрын
Hi, did you solve this? I have the exact same situation. The comments need to be fetched separately and I am not sure which life cycle method to use.
@nickkarnik96885 жыл бұрын
Yes, you should make that request in ComponentDidLoad (If I understand what you're asking correctly).
@nickkarnik96885 жыл бұрын
Looking at the above comment from Wilson, I think I understand what you're asking. If you want to load comments later on, you will need to do it after your primary data loads (either in the callback or when the promise resolves). Otherwise, you might need some trigger such as clicking a button to show comments, which will make the call.
@wilsongaturu1345 жыл бұрын
+Nick Karnick What we ended up doing is creating the action that fetches comments (we were using Redux) and then chaining it to the fetch articles action using ".then". This was done in the ComponentWillMount method. Since we also had comment replies that required the parent comment id, we had a fetch replies button to trigger that event as you suggest.
@crocodileman77906 жыл бұрын
my generate see not working, how is that ?
@karangupta7254 жыл бұрын
dont know why in my code ,render gets printed twice in console?
@sagemode374 жыл бұрын
Maybe you have out console.log('render') in render() method of App.js as well counter.js
@ast4530003 жыл бұрын
too much focus on secondary LM methods, and not enough on the primary ones
@kavitasisodiya58463 жыл бұрын
Can anyone answer that why did he used "disable={this.state.mount}"
@ast4530003 жыл бұрын
this.state.mount === true in the initial state. Look at the state in the constructor. So in the initial state disabled = {true} for that button. When mount is updated in state, disabled will also be updated.
@sivaganesh44894 жыл бұрын
Awesome
@ayushgupta62144 жыл бұрын
can i get the code??
@johndifelice7289 Жыл бұрын
Where are the hooks?
@waqaspathan3337 Жыл бұрын
great video but take "hooks" out of the title, its misleading
@kingwindie6 жыл бұрын
ummmm, what type of vs code is this?
@nickkarnik96886 жыл бұрын
cruz I’m using Webstorm in this video. However, I would also recommend checking out CodeSandbox as I’ve used in my recent videos on my channel.
@JenniferStewart1004 жыл бұрын
Now that react added hooks, this is obsolete.
@H3000-v7i3 жыл бұрын
Typical newbie comment
@spencerknight17303 жыл бұрын
@@H3000-v7i lmao thats all programming videos. newbies trying to be the one with the information
@Jason06245 Жыл бұрын
does anyone know why does my browser console print twice everything? like it prints "constructor" and "render" twice respectively follow this tutorial.
@davidlin7968 Жыл бұрын
might have to do with using strict mode
@someone-on-earth8 ай бұрын
you must've figured it out by now, but I'll post this for anyone facing this. this behavior of react happens only in development and its there to help us catch bugs ahead of time and its actually a feature and not a weird behavior, you should not opt out of this, but even then if you do then you can remove the wrapper.
@sarcasticdna4 жыл бұрын
❤️❤️❤️
@abdulghani7864 жыл бұрын
Where the heck is hooks?? Misleading title 😐
@echonabin4 жыл бұрын
He is not referring to functional hooks instead it's component life cycle hooks that's what it is said so don't be confuse i guess in functional hooks and this life cycle hooks!!
@vikashnirwal4 жыл бұрын
Thanks
@aashikothari39169 ай бұрын
😊
@shashanksharmadon42954 жыл бұрын
Nyco.....
@zerosku964 жыл бұрын
Here I am browsing through React content to find out why my **** doesn't re-render. XD
@letsmakethat23645 жыл бұрын
I watched the entire video and learned very little about React Hooks
@HaxGuru5 жыл бұрын
Lifecycle Hooks has nothing to do with React Hooks.
@nehakhandelwal62373 жыл бұрын
Cannot understand a single thing why what is happening
@vishaljadhav-lf3km6 жыл бұрын
First comment :)
@dec235 жыл бұрын
Not helpful
@kinguinkng44034 жыл бұрын
U have micro for ASMR. Please stop using it for guides.
@ahmedmahfouz63396 жыл бұрын
Please try vue it's more powerful
@GM-xk1nw6 жыл бұрын
no, it's just differente
@ahmedmahfouz63396 жыл бұрын
@@GM-xk1nw mention the difference
@Deliverant6 жыл бұрын
It's not more powerfull, it's "just" vastly easier to learn and super fun to use
@Albertmars326 жыл бұрын
The fact that react is industry standard tells me the opposite
@kwaku_20232 жыл бұрын
@freecodecamp how do you set( this.setState({error, info) ) the error and info to state when it's not initialized in state (this.state), my conditional block is also not running after encountering error in nested component: if (this.state.error) { return Error Found!; }