infer parameters of function passed as prop on a react component

is there any way to infer the parameters values of a function passed with props? I am trying to create a like button that raises an event once the user clicks on it, the like component only call the function passes via props and i handle the click on the main component. The problem is that in the like component i should pass the person object but i cant because i dont know about it, its passes as argument of the callback (onLike)
5 Replies
Filiberto
FilibertoOP2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Filiberto
FilibertoOP2y ago
i could but the like button would not be reusable
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
awexis
awexis2y ago
You can also just make "onLike" an onClick with no params. Since you're using a function already "handle like" that takes in the person already
Want results from more Discord servers?
Add your server