Working with props is foundational knowledge for learning React, and sharing data between components in React is often a necessity. The data, which is referred to as props, is passed down from parent components to child components. This is also called "prop drilling". If you are just learning Javascript, I recommend starting with my full 8 hour Javascript tutorial here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EfAl9bwzVZk.html
Hi, Mr.Dave. I am currently starting on learning ReactJS, and i am watching your videos. There is one thing I am curious about one thing you said in this video. In this video, you said "Avoid the div when you can", that makes me not understand. Can you explain that why do we need to avoid the div, sir?
Dave, you're a priceless teacher. In my opinion, it's easy to understand the topic you're explaining because you talk about the tiny details as well, while many others think that beginners should understand the obvious things, which is often not the case. Thank you!
I'm doing all tutorials you have Dave, very good lesons, i started with Redux when i find your video in the redux website. even already have studed React there´s always something to learn, thanks for sharing this axcelent material.
Bro very well done , You did a excellent job. Really you can't imagine that i could never seen any tutorial same as yours in the past one and half year.
wherever whenever i can openly say that this is the best react course ever and this channel has the best content everrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Dear Dave It is a wonderful course. A clear, simple and complete presentation of React I'm definitely getting a lot out of it. Thank you very very much 🤓🤓🤓
I remember feeling like React is so messy and confusing at first, but that was because my code was unorganized and written really badly. I now find it so beautiful and quick to create things with, haha. Creating and managing components is addictive!
Incredibly helpful! Thank you, Dave! I loved the "aria-label" tip for accessibility. Do you have a video on accessibility features for webapps / webpages?
Great video! I'd love to know why you chose to use an icon with roles and aria labels rather than wrapping the icon in a element? Wouldn't that solve all the accessibility issues and also keep the HTML semantic? Thanks again
Now I understand why they say it's useful to learn vanilla JS before learning libraries. If I'd not spent years learning JS, all this would make no sense at all. React is really JavaScript under the hood. The syntax is simply designed to make building apps with the same or similar components easier. Case in point -> the props drilling wasn't making sense to me. The syntax in App.js looked like HTML (e.g. ). It was only when I used 'typeof props' in the console, that I realised App.js was actually sending an object to 'Content.js'. The Object destructuring using the { } then made sense. Thanks Dave for helping me better understand all this.
Very well explained. Much easier too to deconstruct your props in child components rather than continually referring to the props object and its contents directly in code. I notice that if you delete the item key in the LineItem component itself the app still works ok with no errors. We pass the key (the item id) down as a prop from the ItemList component but it seems we don't need to refer to it in the LineItem child component. Was this just left in by accident?
You are correct! I actually quickly address this in the setup of the next tutorial. You can remove it from the li element. I missed that when pasting into the new component. Another great question Andrew! 🚀
When I first started learning react this type of injection really bothered me about react. I definitely prefer using state management tool like mobx (not everyones favorite, I know, but it works well for the projects I use.)
Thank you, Lavy! 🙏 I often put a tabindex="0" on an element that would not usually get the focus when you tab through the page, but I want it to. Most form elements like inputs and buttons already get focus when tabbing without this. More here: developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
I had to do : style={(item.checked) ? {textDecoration : 'line-through'}:{textDecoration : 'inherit'}} I see you not using the ':' in your code, for me it results in an error (statement expected ":")
When I made this video, I needed to do that.. the extension was updated and I have changed a setting or two since. I do just type rafce in the file these days.
I'm not sure if I understand the hierarchy properly. Is the reusable component, LineItem a child of ItemList? Also, is ItemList is a child of the content component? Thank you for another great tutorial, Dave!
I'm going by memory here, but I think LineItem is a child component of ItemList. ItemList should contain 1 or more LineItems. I don't specifically remember a "content" component, but overall there is a hierarchy. A parent component like App.js can contain many child components - and those child components can have child components of their own, too.
sir this playlist is great but make complete Project in current playlist so that students who learnt from the beginners playlist will gain more knowlege after developing entire application from scratch
So you can pass data down to a child component using props. So what do you do if you want to pass data in the opposite direction, from a child component to a parent component?
@@DaveGrayTeachesCode Just found out how to do this by passing a pointer to a function down from the parent to the child component as a prop. I can understand why you'd want to use the Context API or even Redux though as a central store of data if you've got multiple nested components. Passing data up and down between multiple components can quickly start to get messy.
Hello Dave, I have a question...I chose not to move the two handleCheck and handleDelete functions to App.js and got some cryptic error....am I correct to conclude that javascript functions can't access props' data only jsx can (items and setItems are required for javascript functions)
I think I understand your question. Props are passed into components. Functional components are functions. Within the function component, if you define a function, it should have access to the props that are passed in. It is not limited to JSX only.
@@DaveGrayTeachesCode Thank You Dave, I tried it again but getting error "Uncaught TypeError: Cannot read properties of undefined (reading 'length')" ........maybe I will comeback to it later ,right now I don't even know what am I doing wrong and how to explain it......Thanks again
@@anandprakash7337 I believe if you go to the next lesson you will find your answer for the current problem. It is trying to read the link of an array, but the array doesn't exist right now.