Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid redundant re-rendering #1174

Merged
merged 1 commit into from
Sep 23, 2020

Conversation

takakobem
Copy link
Contributor

Context value should be memoized to avoid re-rendering in consumer components.
Actually, when I18nProvider is re-rendered event if props are not changed, value object is recreated and all consumer components are re-rendered.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • documentation is changed or added

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 95.692% when pulling 7c83a8e on takakobem:avoid-unnecessary-rerendering into afeaebb on i18next:master.

@jamuhl
Copy link
Member

jamuhl commented Sep 23, 2020

Good catch...👍

@jamuhl jamuhl merged commit 06556bf into i18next:master Sep 23, 2020
@jamuhl
Copy link
Member

jamuhl commented Sep 23, 2020

published in react-i18next@11.7.3

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants