diff --git a/src/components/NavExpandableGroup.jsx b/src/components/NavExpandableGroup.jsx index c124c77c16..8a5562fcfa 100644 --- a/src/components/NavExpandableGroup.jsx +++ b/src/components/NavExpandableGroup.jsx @@ -14,15 +14,20 @@ class NavExpandableGroup extends Component { // Extract a list of paths from the route params and store them for later. This creates // an array of url paths associated with any NavItem component rendered by this component. this.navItemPaths = routes.map(({ path }) => path); + + this.isActiveGroup = this.isActiveGroup.bind(this); + this.isActivePath = this.isActivePath.bind(this); } - isActiveGroup = () => this.navItemPaths.some(this.isActivePath); + isActiveGroup () { + return this.navItemPaths.some(this.isActivePath); + } - isActivePath = (path) => { + isActivePath (path) { const { history } = this.props; return history.location.pathname.startsWith(path); - }; + } render () { const { groupId, groupTitle, routes } = this.props;