Преглед на файлове

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`
WhatAKitty преди 8 години
родител
ревизия
3683e0ddfd
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/components/SiderMenu/SiderMenu.js

+ 1 - 1
src/components/SiderMenu/SiderMenu.js

@@ -105,7 +105,7 @@ export default class SiderMenu extends PureComponent {
                   to={itemPath}
                   to={itemPath}
                   target={item.target}
                   target={item.target}
                   replace={itemPath === this.props.location.pathname}
                   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>
                   {icon}<span>{item.name}</span>
                 </Link>
                 </Link>