From 3683e0ddfdb1b9a12f434c2fc0b46dee1fede019 Mon Sep 17 00:00:00 2001 From: WhatAKitty <104xuqiang@163.com> Date: Fri, 29 Dec 2017 10:53:48 +0800 Subject: [PATCH] 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` --- src/components/SiderMenu/SiderMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SiderMenu/SiderMenu.js b/src/components/SiderMenu/SiderMenu.js index e4ea989c..a3a6708f 100644 --- a/src/components/SiderMenu/SiderMenu.js +++ b/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}{item.name} -- GitLab