Skip to content

Commit

Permalink
fix: prev and next dont change when route changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyi7099 committed Nov 4, 2019
1 parent 5cc256f commit fc73a23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@rcpress/theme-default/components/menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export default class LeftMenu extends React.PureComponent<MenuPros, MenuState> {
});
}
}
componentDidUpdate(prevProps: MenuPros) {
if (prevProps.currentPath != this.props.currentPath) {
this.getPreAndNext();
}
}

getPreAndNext = () => {
const { currentPath } = this.props || [];
Expand Down

0 comments on commit fc73a23

Please sign in to comment.