From ea62608e96a1e2fe6db2ec5ea363d46097ba2738 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Thu, 31 Aug 2017 22:05:56 +0530 Subject: [PATCH] fixes #17 --- components/Layout.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/Layout.js b/components/Layout.js index 9c08fc1..3f4402c 100644 --- a/components/Layout.js +++ b/components/Layout.js @@ -215,6 +215,10 @@ export default class Layout extends PureComponent { return path === this.props.pathname ? "active" : ""; } + componentWillMount() { + this.setKey(this.props.pathname) + } + componentDidMount() { this.setKey(this.props.pathname); } @@ -412,6 +416,7 @@ export default class Layout extends PureComponent { onChange={this.onChange} accordion activeKey={this.state.activeKey} + defaultActiveKey={this.state.activeKey} > {x.map((route, i) => { return (