PROPS in React explained 📧
ฝัง
- เผยแพร่เมื่อ 11 ก.ค. 2024
- #React #JavaScript #tutorial
00:00:00 introduction
00:00:56 props
00:04:49 index.css
00:06:28 multiple components
00:07:49 propType
00:10:18 defaultProps
00:11:47 conclusion
// props = read-only properties that are shared between components.
// A parent component can send data to a child component.
// key=value
// propTypes = a mechanism that ensures that the passed value
// is of the correct datatype.
// age: PropTypes.number
// defaultProps = default values for props in case they are not
// passed from the parent component
// name: "Guest"
import Student from './Student.jsx'
function App() {
return(
);
}
export default App
import PropTypes from 'prop-types';
function Student(props){
return(
Name: {props.name}
Age: {props.age}
Student: {props.isStudent ? "Yes" : "No"}
);
}
Student.propTypes ={
name: PropTypes.string,
age: PropTypes.number,
isStudent: PropTypes.bool,
}
Student.defaultProps = {
name: "Guest",
age: 0,
isStudent: false,
};
export default Student
.student{
font-family: Arial, sans-serif;
font-size: 2em;
padding: 10px;
border: 1px solid hsla(0, 0%, 50%, 0.8);
}
.student p{
margin: 0;
}
No word you man priceless help!
@BroCodez !!!! nice to know your not dead :D also, could you do a toutorial for C/C++ windows (kinda like tkinter for python) thx
good job on your vids though, helped me a lot. :)
super simple and easy to understand otherwise, the perfect combo for beginers
I really cannot express how much of a positive impact you’re having on the world. Your videos helped me immensely, the education is poor in my country and i can make it up alot with your videos
We want more React tutorials from bro
👇
Thanks Bro! You are one of those about whom philosophers have said: "The obvious is something that no one sees until someone expresses it in the simplest way."
You are so good man, keep going.
My whole front end development belongs to you.
Thanks a lot.
Thanks Bro! You are really an awesome teacher, and your way of dividing the topic into small lessons are great! That is very much more practical for people to learn than watching a dozens of hours video!
Excellent overview of PROPS!!! Very clear and concise! Please keep going.
blessed to have you as a mentor. A thank you is not enough! Much love ❤
😭dude idk how u knew I was just learning react but thank you for the videos.
I'm from the future
pls make 10hours tutorial of React.js from Beginner to Expart please and please sir, can't pay for tuitions fee but bro code on TH-cam bring more than Degrees@@BroCodez
You are an amazing teacher!! No one should teach coding after you!! 👏🏼👏🏼 Thank you for existing!
Hey, appreciate you popping in with a great video. Saved it.
Broo!!! I learned crazy loads of stuff in this 12 mins than I try to learn past 24 hours. Damn good content bro!! Thank you!!
Thanks!
I just finished watching and I learned a lot from this ❤
This series is awe-inspiring thank you a lot!❤❤❤❤❤❤
Love your vids, focus on essence , easy to understand. Thank you Bro!
I love your videos ❤
Very simple easy to understand
And not to much time taking
I am relatively new to React.js and your explanation make sense and easy to follow. Kudos Bro!
Bro, just 12 minutes was enough to perfectly understand this topic. I've watched several videos about it, but this one is just perfect. Thanks a lot!
Thank you so much for this awesome tutorial
The first video I see that explains clearly that props are an OBJECT and defines them with a punctual sentence and not with a vague terms or with comparisons like "parameter of a function" or "pseudo HTML attribute".
Thanks, now I understand them better, I'll follow the serie.
Wow 😮so easy to understand! Thank you so much ☺️ I just subscribed ❤
Nice explanation buddy. Thank You!!!
First tutorial i watched and i understood thoroughly 🔥
Extremely great presentation ❤
Wow, just nice explanation, love it
Thanks! clear presentation
thanks a ton! u are amazing
pls keep uploading.
Amazing content, Thank you. God bless
Que fácil se hace aprender react con BroCode, muchas gracias, excelente trabajo.
After this pls make a typescript version since typescript is mostly used with popular js frameworks
I mean, I"ve been using TS, you just have to add the right typing, when the IDE screams at you. :D
This was my final code for Student.tsx:
interface StudentProps {
name?: string;
age?: number;
isStudent?: boolean;
}
const Student = ({
name = "Guest",
age = 0,
isStudent = false,
}: StudentProps) => {
return (
Name: {name}
Age: {age}
Student: {isStudent ? "Yes" : "No"}
);
};
export default Student;
My understanding for programming after watching Bros videos 📈📈📈❤
Awesome Explanation bro
God 🎉 bless you.. This is excellently explained 😊
tysm, you really helped me with this topic
please a full React course, even though i'm intermediate in React, your videos are ones i learn the most from
over 2 year ago i decided to change careers and learn coding, i started with your python videos, and today im an intern swe (mobile application development), currently learning react-native and still watch you Bro-Code. My programming Kinng 😤🙌 i wanna see more of this new seriesssss!!!
hey bro how did you get the job, can help me to know how you did it
Exquisite 🙌🏾
easy to understand , thank u
Thank you soo much i love ur videos
Nice lesson!😁
Thanks your tutorial ❤
clean and simple , loved it
🌮
nice viedo very infornative ✌
cool video bro!
thanks a million bro
TY ❤
Thanks Bro!
Waiting for it Thanks a lot bro ❤
Please make it bit quick 🙏
Thank you bro more react videos
Amazing 👏
Thanks Bro!
I really needed this playlist completed as i need to learn react and you arrived just in time !
Respect ❤
Love u brooo❤
props to you Bro
'props' to you for making this video lol
I loled at that one
You never miss
so great
Perfect
YOUR BACK 🎉🎉🎉🎉
not gonna start the series until you complete it anyways for the algorithm 🔥🔥🔥
Nice
perfect ;P
sensei waiting for the next video
Live it
👑
hoooks bro
Be like bro code
Absolutely legendary BROgramer
❤❤
Bro you have to finish the Playlist in less than 3 months I'm doing my final computer science proj using React and I need your explanation ❤
wow
Can you do nodejs tutorial 😆 Your videos its easy to understand
Kindly, make a complete video on React Js and React Native (Including User Login Authention from Mysqli database).
i love this, but i have a question. how would we go about different images for each student? ive tried to figure it out myself but to no avail. thanks!
sensei
Can you do a video with a full course of Visual BASIC Programming language??
bro, pls make a full course on android mobile application programming, maybe with Java or Kotlin. Thank you for your courses!
W
кайф!
The proptypes and the defaultprops does not have any color, beside white on my visual studio code what should I do ?, I know it's working but I want color to check if I type wrong or not please help
there is no need of import defaultProps in the Students.jsx file?
could you also make a deno fresh series?
Are you making a longer react tutorial slated to release in 2024?😊
waiting for react Hooks and CRUD operations
assalomu alaykum qales Muhiddin aka
Bro, is there a way to enable autocomplete/ intellisense for prop.[dot] ... ?
coming from java, this is really annoying and easy to make silly typos
Excellent ❤❤❤
Please give us a blazor tutoriel after. Net 8
bro bros voice change a lot in 2years
I think yt spies me cuz I am on a course and I'm on the props part n this shows up
huge thanks!
Strange why not called propDefaults
16th comment
Lessons
bro code is da besstt
Sir, we need 10Hours React for total Begnner please
Hi! I have a python project. And i want to create a gui for it. How do i? I dont know. Can you teach me or how do i learn it?
use a gui library for python
@@hunin27 how?
make a full couse on x86 assembly language
How do you know I have a react project for college😭thank you
This is
Do you still love pizza?
always and forever
Hey bro, can you help me by coding chess game?