Passing Props From Child to Parent Component in React.js

preview_player
Показать описание

The first method is to simply pass a function to the child component that allows you to set a value in the parent component.

🌎 Follow me here:
Рекомендации по теме
Комментарии
Автор

If you use this. method and are having trouble testing, you need to render out your component and then pass that function into the render method. If anyone is struggling I can make a video explaining how to test these component correctly.

TomDoesTech
Автор

Just when I was about to give up, I stumbled on this video. Thank you so much. You explained EXACTLY what I sas looking for.

adriennobel
Автор

this is by far the best video on the subject with the best implementation

alextana
Автор

More than 2 hours searching, this is the literally I was looking for. Thanks a lot

Hello_VVolf
Автор

This is just awesome. Short, precise, clear. Liked and suscribed.

KalSt
Автор

Tom, I just want to give you a heartfelt thanks for this fantastic video.

rtc
Автор

Thanks to you I can sleep more soundly this evening. (I've been at a roadblock on my bootcamp capstone app for two days!!)

holyfreakinguacamole
Автор

Awesome, didn't know about the useFilters method ❤️

johnbeckham
Автор

This is an amazing video, learned things I need to know and found out things I need to learn more about.

Tubee
Автор

Thanks. This is exactly what I was looking for. This will make my code much simpler

kevinquinn
Автор

Exactly what I needed for my React component npm library!

LePhenixGD
Автор

Explain a lot, clear and short wonderful

AgitNaeta
Автор

Glad to see others got it. This was not clear to me. :(
For beginners like me you should 1: Give a better overlook of all your code at the beginning of the demo; 2: Your explanation deserved a slower pace or maybe a better use case.
All the best!

tudoralexandruienulescu
Автор

hmm... It seems like in the second method you just made something some people call "custom hook"🤔 correct me if I get it wrong. Anyway, great explanation! Thanks a lot!!!

Emmamarsillustration
Автор

This works but gives this warning in the console :
Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.

any chance of this method being not correct ?

dr_davinci
Автор

feedback : audio is so so low brother, make it louder by your mike aur like by the help of software.
I am not able to hear anything in my all device without earphone

williamjames
Автор

This is what iwas looking you saved my hours

rahulmakwana
Автор

@3:00 I don't get it. We can change the state by setting the state. But in the case of search, greaterThan, lessThan you are just simply returning these variables and accessing them from other components. You are changing their values without setting a state. Can you explain it to me?

HaiderAli-oifm
Автор

@1:28 "pass the props down from the child to the parent" confused me for a second.

Momosun
Автор

what to do when I have input tag as a child component and I want to fetch the value of the input tag from the parent component...there are many child component refrenced in the parent component

PlayingCode