We've learned earlier that a parent passes data to a child component by props. What about passing data from a child to a parent? The simplest way for child to talk to a parent is to call a function given from that parent:
1
type CounterProps ={increment:()=>void;decrement:()=>void;}