Fix crash when Label is passed as content to LabelList#6732
Fix crash when Label is passed as content to LabelList#6732ckifer merged 1 commit intorecharts:mainfrom
Conversation
WalkthroughRemoves the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
🧰 Additional context used📓 Path-based instructions (4)src/**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (DEVELOPING.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (DEVELOPING.md)
Files:
**/*.{js,ts,tsx}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
src/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6732 +/- ##
=======================================
Coverage 94.02% 94.02%
=======================================
Files 500 500
Lines 42684 42685 +1
Branches 4917 4917
=======================================
+ Hits 40135 40136 +1
Misses 2544 2544
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Fixed a stack overflow crash that occurred when
<LabelList content={Label} />was used. The crash was caused byLabelListpassing thecontentprop (which wasLabelitself) back to theLabelcomponent, creating an infinite recursion loop whereLabelkept trying to render itself as its own content.Fixes #6633
Changes
src/component/Label.tsxto explicitly exclude thecontentprop from the props passed to the content function component.Labelrenders a dynamic component (like itself), that component doesn't receive thecontentprop again, breaking the recursion cycle.Verification
test/component/ReproduceCrash.spec.tsx(which I verified passes now).Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.