PROPS in React explained 📧
Вставка
- Опубліковано 19 чер 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
You are so good man, keep going.
My whole front end development belongs to you.
Thanks a lot.
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."
😭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 UA-cam bring more than Degrees@@BroCodez
blessed to have you as a mentor. A thank you is not enough! Much love ❤
We want more React tutorials from bro
👇
Excellent overview of PROPS!!! Very clear and concise! Please keep going.
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!
You are an amazing teacher!! No one should teach coding after you!! 👏🏼👏🏼 Thank you for existing!
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!!
I am relatively new to React.js and your explanation make sense and easy to follow. Kudos Bro!
Thanks!
I just finished watching and I learned a lot from this ❤
Thank you so much for this awesome tutorial
Love your vids, focus on essence , easy to understand. Thank you Bro!
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.
Hey, appreciate you popping in with a great video. Saved it.
I love your videos ❤
Very simple easy to understand
And not to much time taking
This series is awe-inspiring thank you a lot!❤❤❤❤❤❤
Nice explanation buddy. Thank You!!!
thanks a ton! u are amazing
pls keep uploading.
First tutorial i watched and i understood thoroughly 🔥
Wow, just nice explanation, love it
Thanks! clear presentation
Wow 😮so easy to understand! Thank you so much ☺️ I just subscribed ❤
Amazing content, Thank you. God bless
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
Extremely great presentation ❤
Thanks your tutorial ❤
Thank you soo much i love ur videos
easy to understand , thank u
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;
clean and simple , loved it
🌮
Que fácil se hace aprender react con BroCode, muchas gracias, excelente trabajo.
Exquisite 🙌🏾
God 🎉 bless you.. This is excellently explained 😊
thanks a million bro
Thanks Bro!
I really needed this playlist completed as i need to learn react and you arrived just in time !
Respect ❤
My understanding for programming after watching Bros videos 📈📈📈❤
Thank you bro more react videos
nice viedo very infornative ✌
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
Nice lesson!😁
TY ❤
Waiting for it Thanks a lot bro ❤
Please make it bit quick 🙏
props to you Bro
Amazing 👏
Perfect
so great
cool video bro!
not gonna start the series until you complete it anyways for the algorithm 🔥🔥🔥
You never miss
Nice
Love u brooo❤
perfect ;P
Live it
YOUR BACK 🎉🎉🎉🎉
sensei waiting for the next video
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!
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 ❤
'props' to you for making this video lol
I loled at that one
Can you do a video with a full course of Visual BASIC Programming language??
hoooks bro
huge thanks!
Kindly, make a complete video on React Js and React Native (Including User Login Authention from Mysqli database).
👑
wow
❤❤
bro, pls make a full course on android mobile application programming, maybe with Java or Kotlin. Thank you for your courses!
Are you making a longer react tutorial slated to release in 2024?😊
Can you do nodejs tutorial 😆 Your videos its easy to understand
Be like bro code
Absolutely legendary BROgramer
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
could you also make a deno fresh series?
sensei
W
waiting for react Hooks and CRUD operations
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
кайф!
assalomu alaykum qales Muhiddin aka
Please give us a blazor tutoriel after. Net 8
Strange why not called propDefaults
How do you know I have a react project for college😭thank you
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
Lessons
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?
This is
make a full couse on x86 assembly language
16th comment
bro code is da besstt
Hey bro, can you help me by coding chess game?
bro code pls colab
what
random comment 3.0
Do you still love pizza?
always and forever
i'll ask you a full Java Spring Boot course
You made my day. Thank you. What's your email ?