How to Pass Data from Child to Parent Component in React?

preview_player
Показать описание
To pass data from a child to a parent component in React:
1: Pass a function as a prop to the Child component.
2: Call the function in the Child component and pass the data as arguments.
3: Access the data in the function in the Parent.
Рекомендации по теме
Комментарии
Автор

thank you so much ..all the way from Algeria, that helped me 😁

mokraneidris
Автор

Only through function and clicking way we can pass thr props from child to parent?

vaishusiva
Автор

Thank you from Sydney, hit me up if you come down under!

yungrut
Автор

Thanks, it works perfectly! However, I don't understand why this is working!
How is the Parent aware of the data that the Child is managing?

prime_time_youtube
Автор

why you wouldn't you just pass the built-in function setMessage as a prop to send the data?

kumpalikumpa
Автор

you are not explaining just doing coding

rohinibiradar
Автор

where you from ovoovovov your pronouns

Atahualpa-king