Skip to content

Commit

Permalink
Merge pull request #878 from nicolasschabram/feature/master_reloadNam…
Browse files Browse the repository at this point in the history
…espacesOnChange

Reload translations whenever namespaces passed to useTranslation() change
  • Loading branch information
jamuhl authored Jun 20, 2019
2 parents 21ed9bc + d4b4ec4 commit d946ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function useTranslation(ns, props = {}) {
if (bindI18nStore && i18n)
bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
};
}, []); // define props to trigger using effect on rerender (none here)
}, [namespaces.join()]); // re-run effect whenever list of namespaces changes

const ret = [t.t, i18n, ready];
ret.t = t.t;
Expand Down

0 comments on commit d946ee8

Please sign in to comment.