How would I pass a parameter through onClick without creating an in-line arrow function? #26555
-
I'm trying to make a button that passes data that then affects what happens when the button is clicked.
This produces the result that I want, but I want to avoid creating an in-line arrow function and just use the useCallback hook. I considered getting the data from the event object, but How would I pass a parameter through onClick without creating an in-line arrow function? How can I use the FluentUI v9 button and pass information to its onClick including event? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can create a handleClick function that expects an event param, and use that as the onClick value.
|
Beta Was this translation helpful? Give feedback.
You can create a handleClick function that expects an event param, and use that as the onClick value.