fix: labelRef being passed to DOM node causing warning#6008
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6008 +/- ##
==========================================
- Coverage 96.24% 96.24% -0.01%
==========================================
Files 194 194
Lines 19629 19629
Branches 4023 4021 -2
==========================================
- Hits 18892 18891 -1
- Misses 731 732 +1
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 55 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
|
|
|
||
| if (isValidElement(content)) { | ||
| return cloneElement(content, props); | ||
| return cloneElement(content, filterProps(props, true)); |
There was a problem hiding this comment.
doesn't this mean it'll also be filtered out if the validElement is Label itself?
There was a problem hiding this comment.
When type is Label, it is being handled inside parseLabel itself.
if (isValidElement(label)) {
if (label.type === Label) {
return cloneElement<LabelProps>(label, { key: 'label-implicit', ...commonProps });
}
return <Label key="label-implicit" content={label} {...commonProps} />;
}
ckifer
left a comment
There was a problem hiding this comment.
Good enough for now thanks for the fix
|
There is now no label being rendered, can it be related to this PR? https://www.chromatic.com/test?appId=63da8268a0da9970db6992aa&id=685bd07ec377767b042a0408 Edit: false alarm, the labels are still there - but delayed. Looks like a VR snapshot problem. |
|
@PavelVanecek from what I can see you were right - this is the storybook link from that snapshot https://63da8268a0da9970db6992aa-tzmlwrsuhc.chromatic.com/?path=/story/examples-linechart--with-customized-label no labels no matter the delay @saurabhraj123 can you look? |
checking |
<!--- Provide a general summary of your changes in the Title above --> ## Description Fix: label not being rendered due to filterProps ## Related Issue #6008 <!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: --> ## Screenshots (if appropriate): Fix: <img width="1430" alt="Screenshot 2025-06-26 at 10 11 53 AM" src="https://github.com/user-attachments/assets/1a5915fb-9031-41e0-8b16-8ded115f896e" /> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] I have added a storybook story or extended an existing story to show my changes
Description
labelRefwas being passed to a DOM node. It is not a valid node prop and was causing warning.Related Issue
#6004
#5880
Types of changes
Checklist: