TabsBar: move withRouter to outer component
This commit is contained in:
@ -20,7 +20,6 @@ const messages = defineMessages({
|
||||
post: { id: 'tabs_bar.post', defaultMessage: 'Post' },
|
||||
});
|
||||
|
||||
@withRouter
|
||||
class TabsBar extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
@ -162,10 +161,6 @@ const mapStateToProps = state => {
|
||||
notificationCount: state.getIn(['notifications', 'unread']),
|
||||
chatsCount: state.get('chats').reduce((acc, curr) => acc + Math.min(curr.get('unread', 0), 1), 0),
|
||||
dashboardCount: reportsCount + approvalCount,
|
||||
|
||||
// HACK: We made things too efficient and now the tabs bar doesn't work right
|
||||
// ¯\_(ツ)_/¯
|
||||
forceRerender: Math.random(),
|
||||
};
|
||||
};
|
||||
|
||||
@ -178,6 +173,6 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
},
|
||||
});
|
||||
|
||||
export default injectIntl(
|
||||
export default withRouter(injectIntl(
|
||||
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
|
||||
)(TabsBar));
|
||||
)(TabsBar)));
|
||||
|
||||
Reference in New Issue
Block a user