Skip to content
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

Fix CreateButton not being re-translated when language change at runtime #2842

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

maoueh
Copy link
Contributor

@maoueh maoueh commented Jan 31, 2019

The CreateButton is using an optimization to re-render only a certain set of keys change. However, the translate prop was not part of that. This was causing the component to not re-render when the translate function was updated due to language having changed.

This is now fixed by specifying the translate as being a prop change that causes a re-render.

Fixes #2830

…ntime

The `CreateButton` is using an optimization to re-render only a certain set
of keys change. However, the `translate` prop was not part of that. This
was causing the component to not re-render when the translate function was
updated due to languague having changed.

This is now fixed by specifying the `translate` as being a prop change
that causes a re-render.

Fixes marmelab#2830
@maoueh
Copy link
Contributor Author

maoueh commented Jan 31, 2019

I was really lucky (or it was a real bad luck) to hit that as CreateButton was the only place where onlyUpdateForKeys was used in conjunction with translate HOC :)

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great description. Thanks !

@djhi djhi added this to the v2.6.4 milestone Jan 31, 2019
@djhi djhi merged commit 8777785 into marmelab:master Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buttons in custom Dashboard not re-rendered on language switch
2 participants