You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to extract some part of the component into a generic one. Most of the extraction is simple but I don't know how to make it accept the event names via component Prop and pass the names to the on/off function.
However, there will be error if I pass a string variable instead of providing a string argument directly the functions. Any idea how I could solve this? I don't understand how the argument type work here.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a component using mitt like this:
I am trying to extract some part of the component into a generic one. Most of the extraction is simple but I don't know how to make it accept the event names via component Prop and pass the names to the on/off function.
What I want to do:
ItemDataUpdater.tsx
However, there will be error if I pass a string variable instead of providing a string argument directly the functions. Any idea how I could solve this? I don't understand how the argument type work here.
Beta Was this translation helpful? Give feedback.
All reactions