-
Notifications
You must be signed in to change notification settings - Fork 14.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
fix(dnd): make clicked dnd metrics unique #16632
fix(dnd): make clicked dnd metrics unique #16632
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16632 +/- ##
=======================================
Coverage 76.77% 76.77%
=======================================
Files 1003 1004 +1
Lines 53959 53965 +6
Branches 7330 7333 +3
=======================================
+ Hits 41427 41432 +5
- Misses 12293 12294 +1
Partials 239 239
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
(cherry picked from commit 9dfa33f)
🏷️ 2021.36 |
1 similar comment
🏷️ 2021.36 |
(cherry picked from commit 9dfa33f)
🏷 2021.34 |
SUMMARY
When creating a metric using the click handler on DnD, we currently memoize an instance of
adhocMetric
that becomes the reference for all future clicked adhoc metrics. This causes all adhoc metrics that have been created by clicking to be mutated whenever we edit an adhoc metric that was also created by clicking.To avoid unnecessary rerenders that would be a consequence of simply removing
useMemo
, we here instead initialize thedroppedItem
to an empty object, which then returns a freshadhocMetric
for each click.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION