I have three actions supporting my SpeedDialAction, however when I try to log the event of the individual actions onClick, I get undefined.
I have tried using different functions as actions, also tried arrow function syntax in the method call
onClick={e => action.action(e)}
and
onClick={action.action}
The actions:
const actions = [
{ icon: <Add />, name: 'Product', action: handleDialogOpen },
{ icon: <Add />, name: 'Addon', action: handleDialogOpen },
{ icon: <Label />, name: 'Tag', action: handleDialogOpen }
]
The SpeedDial:
<SpeedDial
ariaLabel='SpeedDial example'
className={classes.speedDial}
icon={<SpeedDialIcon />}
onBlur={handleClose}
onClick={handleClick}
onClose={handleClose}
onFocus={handleOpen}
onMouseEnter={handleOpen}
onMouseLeave={handleClose}
open={open}
>
{actions.map(action => (
<SpeedDialAction
tooltipOpen
key={action.name}
icon={action.icon}
tooltipTitle={action.name}
onClick={action.action}
/>
))}
</SpeedDial>
handleDialogOpen simply tries to log the event
I expect the output being an event object, not undefined.