React: How to call a Function from Another Component (child component)

preview_player
Показать описание
(We're free online community, meet other makers!)

#react #reactjs #webdev #webdevelopment #coding #programming #frontend this tutorial I'll show you how to call a function from another component. The function fun() will be defined in main App component. By passing the function as a prop to another component (its child), you can call that function from the child component on button click.

00:00 How to call function from another component in React
Рекомендации по теме
Комментарии
Автор

This is really EASIEST explanation of props I ever seen! 👌🏻👍🏻

romanbogoudinov
Автор

Thank you for the clear and straight forward demo of this concept.

iqaznili
Автор

the big question is we could pass the fn by props but how to gets its value... i mean from child i called a fn inside parent but how to get its value generated by that fn.... i guesss by Usecontext in parent component will not work because its has already passed the value before the fn inside the parents generted it

rohanagrawal
join shbcf.ru