Skip to content

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

Merged
djhi merged 1 commit into
marmelab:masterfrom
maoueh:fix/create-button-runtime-translation
Jan 31, 2019
Merged

djhi merged 1 commit into
marmelab:masterfrom
maoueh:fix/create-button-runtime-translation

Conversation

@maoueh

@maoueh maoueh commented Jan 31, 2019

Copy link
Copy Markdown
Contributor

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

maoueh commented Jan 31, 2019

Copy link
Copy Markdown
Contributor Author

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 :)

@djhi djhi left a comment

Copy link
Copy Markdown
Contributor

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