Sometimes we may need to call a function residing in the parent component from the child component.
In this example, we have a function named capitalizeTitle() which capitalizes the title passed to it.
This function is currently residing in the ParentComponent. We can invoke it using an anonymous function from the child component as follows:
In the above example, in the ChildComponent, we call the capitalizeTitle method inside the ParentComponent. We needed to pass the method via prop to access it.