Browse Source

Fix warning of applying `bool` into onClick prop (#521)

fix warning: Failed prop type: Invalid prop `onClick` of type `boolean` supplied to `Link`, expected `function`
pull/416/merge
WhatAKitty 8 years ago
committed by ddcat1115
parent
commit
3683e0ddfd
  1. 2
      src/components/SiderMenu/SiderMenu.js

2
src/components/SiderMenu/SiderMenu.js

@ -105,7 +105,7 @@ export default class SiderMenu extends PureComponent {
to={itemPath}
target={item.target}
replace={itemPath === this.props.location.pathname}
onClick={this.props.isMobile && (() => { this.props.onCollapse(true); })}
onClick={this.props.isMobile ? () => { this.props.onCollapse(true); } : undefined}
>
{icon}<span>{item.name}</span>
</Link>

Loading…
Cancel
Save