I'm currently learning how use React with Typescript and came across this situation: I need to pass down a function to a child component as a prop, and let's say this is a quite complicated function with a punch of parameters. What do you think would be the best approach for this? If this is a Class Component I could just export the function type like this and have the child component implement it:
export type ParentFunction1 = Parent['function1'];
...
type ChildComponentProps = {
handleClick: ParentFunction1;
}
But since I'm using Function Expression Components, the above method is not possible.
Any suggestion would be greatly appreciated!