From 313c799a3e753c9e49ed8536ee08a6bbf32484f3 Mon Sep 17 00:00:00 2001 From: macca16 Date: Mon, 30 May 2016 12:30:44 +0100 Subject: [PATCH] Map props.key to state.intl.locale See proposed solution to switching locales with react-redux https://github.com/yahoo/react-intl/issues/234#issuecomment-163366518 I tweaked mapStateToProps to set props.key to state.intl.locale so that a re-render occurs when locale is hot swapped. --- src/components/Provider.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Provider.js b/src/components/Provider.js index 54c6794..12774fb 100644 --- a/src/components/Provider.js +++ b/src/components/Provider.js @@ -7,6 +7,7 @@ const mapStateToProps = (state) => { const {intl} = state return { ...intl, + key: intl.locale, } }