Procházet zdrojové kódy

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 před 8 roky
rodič
revize
3683e0ddfd
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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}
                   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>