Skip to content

Commit

Permalink
Avoid setState while rendering
Browse files Browse the repository at this point in the history
As documented in #1124 (comment)
this fix should avoid `setState` while react is rendering.
  • Loading branch information
rmedaer committed Aug 26, 2020
1 parent a144e14 commit b7b2869
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/useTranslation.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export function useTranslation(ns, props = {}) {
// not yet loaded namespaces -> load them -> and trigger suspense
throw new Promise(resolve => {
loadNamespaces(i18n, namespaces, () => {
if (isMounted.current) setT(getT());
resolve();
});
});
Expand Down

0 comments on commit b7b2869

Please sign in to comment.