소스 검색

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}
                   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>