-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wasted renders when the parent component re renders #355
Comments
We once had PureComponents in place - but they did cause the opposite...not rerendering when needed. Personally we do not use the hoc on every component but pass down the Any improvement would be welcome...but i don't accept a simple replacement of Component with PureComponent. |
What do you think about adding a new option like |
could live with that... |
Cool I will make a PR |
PR #357 |
was merged |
Could someone explain what difference |
You get a reload...when translations changes -> on init when loading a lot of namespaces that or feeding resources manually that rerender could happen a few times -> as state changes multiple times. you can play with the settings for bindStore, bindI18n (eg. set bindStore to false, bindI18n to languageChanged) https://react.i18next.com/components/translate-hoc.html#a-set-those-on-i18next-init usePureComponents might also avoid rerenderings...but might have sideeffects in not rerendering when language changes.... |
Every time parent component re renders the child components that are wrapped with translate HOC are rerendering because the HOC is using
Component
notPureComponent
. Is there a way to prevent this?The text was updated successfully, but these errors were encountered: