aboutsummaryrefslogtreecommitdiffstats
path: root/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-08 23:19:39 +0800
committerFabio Berger <me@fabioberger.com>2018-03-08 23:19:39 +0800
commit8057f4a678f5e4c00241ec9b15bd9d4dfc3588df (patch)
treead08f11e6e2ac0d8fea0708652e3defe3ad89df6 /packages/react-shared/src/ts/components/nested_sidebar_menu.tsx
parentf9ec8a0828b7f75276491e496a4ae62e5301a6f3 (diff)
downloaddexon-0x-contracts-8057f4a678f5e4c00241ec9b15bd9d4dfc3588df.tar.gz
dexon-0x-contracts-8057f4a678f5e4c00241ec9b15bd9d4dfc3588df.tar.zst
dexon-0x-contracts-8057f4a678f5e4c00241ec9b15bd9d4dfc3588df.zip
Add back strict null checks to react-shared package and fix issues
Diffstat (limited to 'packages/react-shared/src/ts/components/nested_sidebar_menu.tsx')
-rw-r--r--packages/react-shared/src/ts/components/nested_sidebar_menu.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx b/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx
index f562b3113..2225bd197 100644
--- a/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx
+++ b/packages/react-shared/src/ts/components/nested_sidebar_menu.tsx
@@ -65,7 +65,8 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
<div>
{this.props.sidebarHeader}
{!_.isUndefined(this.props.versions) &&
- !_.isUndefined(this.props.selectedVersion) && (
+ !_.isUndefined(this.props.selectedVersion) &&
+ !_.isUndefined(this.props.onVersionSelected) && (
<div style={{ maxWidth: maxWidthWithScrollbar }}>
<VersionDropDown
selectedVersion={this.props.selectedVersion}
@@ -150,6 +151,8 @@ export class NestedSidebarMenu extends React.Component<NestedSidebarMenuProps, N
private _onMenuItemClick(name: string): void {
const id = utils.getIdFromName(name);
utils.setUrlHash(id);
- this.props.onMenuItemClick();
+ if (!_.isUndefined(this.props.onMenuItemClick)) {
+ this.props.onMenuItemClick();
+ }
}
}