Updated ListItem onClick handler

• Updated:
- ListItem onClick handler
This commit is contained in:
mgabdev 2020-08-07 17:42:44 -05:00
parent 0295330eba
commit 9482a61c05
1 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,12 @@ export default class ListItem extends PureComponent {
hideArrow: PropTypes.bool, hideArrow: PropTypes.bool,
} }
handleOnClick = (e) => {
if (!!this.props.onClick) {
this.props.onClick(e)
}
}
render() { render() {
const { const {
title, title,
@ -102,7 +108,7 @@ export default class ListItem extends PureComponent {
<Button <Button
to={to} to={to}
href={href} href={href}
onClick={onClick} onClick={!!onClick ? this.handleOnClick : undefined}
className={containerClasses} className={containerClasses}
noClasses noClasses
> >