Skip to content

Commit

Permalink
fix react-router-redux's race with react-router's context (remix-run/…
Browse files Browse the repository at this point in the history
  • Loading branch information
yanivel committed Sep 10, 2017
1 parent d86af6b commit 19f4ed4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Language/LanguageSetter.js
@@ -1,15 +1,15 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router-dom';
import { connect } from 'react-redux';
import { actions as settingActions, selectors as settingSelectors } from '../../redux/modules/settings';
import { LANGUAGES, DEFAULT_LANGUAGE } from '../../helpers/consts';

// NOTE: yaniv -> edo: should we block rendering until language changed?

const LanguageSetter = connect(
const LanguageSetter = withRouter(connect(
state => ({
currentLanguage: settingSelectors.getLanguage(state.settings),
location: state.router.location
}),
{ setLanguage: settingActions.setLanguage }
)(class extends React.Component {
Expand Down Expand Up @@ -51,6 +51,6 @@ const LanguageSetter = connect(
render() {
return this.props.children;
}
});
}));

export default LanguageSetter;

0 comments on commit 19f4ed4

Please sign in to comment.