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: Use deep equality check for plugin props on componentDidUpdate to avoid unnecessary updates #254

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

neeilya
Copy link
Contributor

@neeilya neeilya commented Apr 12, 2019

Fixes DHIS2-6597.

Problem:

Chart items re-render in dashboards app even if props stay the same (triggers by editing text item).

Proposal:

Use lodash/isEqual function to check equality of props (config & filter) to determine if component should re-render the chart.

@neeilya neeilya requested a review from edoardo April 12, 2019 13:46
Copy link
Member

@edoardo edoardo left a comment

Choose a reason for hiding this comment

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

The fix looks fine, but I wonder why config and filter change when an unrelated TextItem changes. It seems like we should figure out that and see if we can fix/optimise there.

@neeilya
Copy link
Contributor Author

neeilya commented Apr 29, 2019

Going to merge this one as a temp fix until we fix store design in dashboards app.

@neeilya neeilya merged commit 93f71ab into master Apr 29, 2019
@neeilya neeilya deleted the fix/plugin-redundant-updates branch April 29, 2019 11:19
jenniferarnesen added a commit that referenced this pull request Apr 29, 2019
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 33.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 33.1.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants