PROPS in React explained 📧
HTML-код
- Опубликовано: 28 июн 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.
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."
blessed to have you as a mentor. A thank you is not enough! Much love ❤
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!
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!
Hey, appreciate you popping in with a great video. Saved it.
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!!
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!
Thank you so much for this awesome tutorial
😭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 RUclips bring more than Degrees@@BroCodez
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.
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!
thanks a ton! u are amazing
pls keep uploading.
Nice explanation buddy. Thank You!!!
Extremely great presentation ❤
Thanks! clear presentation
Wow, just nice explanation, love it
Amazing content, Thank you. God bless
clean and simple , loved it
🌮
please a full React course, even though i'm intermediate in React, your videos are ones i learn the most from
Wow 😮so easy to understand! Thank you so much ☺️ I just subscribed ❤
First tutorial i watched and i understood thoroughly 🔥
Exquisite 🙌🏾
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;
Que fácil se hace aprender react con BroCode, muchas gracias, excelente trabajo.
tysm, you really helped me with this topic
My understanding for programming after watching Bros videos 📈📈📈❤
Thanks your tutorial ❤
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 viedo very infornative ✌
Awesome Explanation bro
Nice lesson!😁
Thank you soo much i love ur videos
thanks a million bro
God 🎉 bless you.. This is excellently explained 😊
Thank you bro more react videos
Amazing 👏
not gonna start the series until you complete it anyways for the algorithm 🔥🔥🔥
Thanks Bro!
cool video bro!
TY ❤
props to you Bro
Waiting for it Thanks a lot bro ❤
Please make it bit quick 🙏
Thanks Bro!
I really needed this playlist completed as i need to learn react and you arrived just in time !
Respect ❤
Perfect
so great
Nice
Love u brooo❤
You never miss
Can you do a video with a full course of Visual BASIC Programming language??
sensei waiting for the next video
YOUR BACK 🎉🎉🎉🎉
Live it
Kindly, make a complete video on React Js and React Native (Including User Login Authention from Mysqli database).
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 ❤
perfect ;P
'props' to you for making this video lol
I loled at that one
👑
Are you making a longer react tutorial slated to release in 2024?😊
hoooks bro
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!
wow
could you also make a deno fresh series?
bro, pls make a full course on android mobile application programming, maybe with Java or Kotlin. Thank you for your courses!
❤❤
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
Strange why not called propDefaults
Please give us a blazor tutoriel after. Net 8
waiting for react Hooks and CRUD operations
huge thanks!
Can you do nodejs tutorial 😆 Your videos its easy to understand
W
sensei
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
I think yt spies me cuz I am on a course and I'm on the props part n this shows up
кайф!
Sir, we need 10Hours React for total Begnner please
Excellent ❤❤❤
make a full couse on x86 assembly language
bro bros voice change a lot in 2years
How do you know I have a react project for college😭thank you
assalomu alaykum qales Muhiddin aka
Lessons
This is
bro code is da besstt
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?
16th comment
bro code pls colab
Hey bro, can you help me by coding chess game?
Do you still love pizza?
always and forever