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 (