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
notfiliberto
notfiliberto15mo ago
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
notfiliberto
notfiliberto15mo ago
i could but the like button would not be reusable
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
awexis
awexis15mo 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
More Posts
Does cache control header work out of the box on self hosted NextJS APIs?Does the ``` "Cache-Control": "s-maxage=123123123" ``` work out of the box with self hosted NextJLooking for advice on how to fetch/load an onboarding bannerI'm using T3 inside a monorepo (turbo repo). For new users, I have a Get Started page that has a hanStack for Discord Bot + WebinterfaceHello! I am new to the t3-app stack and was wondering how to properly implement a service like discStripe webhook errorNext 12: I've followed Next official guide for integrating stripe into my published site on vercel, `onSuccess` is typed correctly as `data: ReturnItem` for one mutation but as `data: any` for another`onSuccess` is typed correctly as `data: ReturnItem` for one mutation but as `data: any` for anotherGoogle Provider when deployingI'm trying to deploy my project on vercel with a custom domain, but I'm getting an error that says sA Complex Union TypeHow to get this union type: ```js type MyType = "x:a" | "x:b" | "x:c" | "y:d" | "y:f" | "y:g"; ``` How do headless-ui expose context variable for child components?Hey I'm trying to recreate a similar pattern to what is used in `headless-ui` Menu components. httpsIs there something like tailwind ui / headless ui for react native?I'm a big fan of tailwindcss, but in order to speed up my process even more, I like to use somethingHow to handle Prisma schema changes with PlanetScaleFeeling sooooo confused about what I thought should be a simple concept. I made a prisma schema chan