Conversation
There was a problem hiding this comment.
Pull Request Overview
Fixes TypeScript type definitions for PieLabel components by introducing proper type safety for pie label rendering props and removing unnecessary @ts-expect-error comments.
- Introduces new
PieLabelRenderPropstype to properly type pie label functions - Updates
PieLabeltype from genericImplicitLabelListTypeto specific pie label union type - Removes multiple
@ts-expect-errorsuppressions that are no longer needed
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
test/state/selectors/pieSelectors.spec.tsx |
Removes @ts-expect-error comments and updates test types |
test/polar/Pie.spec.tsx |
Adds test coverage for PieLabel props and updates type imports |
src/state/types/PieSettings.ts |
Introduces typed PiePresentationProps for presentation properties |
src/state/selectors/pieSelectors.ts |
Updates return type annotation to use ReadonlyArray |
src/shape/Sector.tsx |
Excludes dangerouslySetInnerHTML from Props type |
src/polar/Pie.tsx |
Major type improvements including new PieLabelRenderProps and updated PieLabel types |
src/component/LabelList.tsx |
Updates Props type to exclude refs using PropsWithoutRef |
Comments suppressed due to low confidence (1)
src/polar/Pie.tsx:535
- Variable
tooltipPayloadis declared asTooltipPayloadbut assigned an array[{...}]. This should be declared asTooltipPayload[]orReadonlyArray<TooltipPayload>to match the actual value being assigned.
const tooltipPayload: TooltipPayload = [
{
name,
value: val,
payload: entryWithCellInfo,
dataKey,
type: tooltipType,
},
];
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6313 +/- ##
=======================================
Coverage 96.63% 96.63%
=======================================
Files 221 221
Lines 20287 20289 +2
Branches 4157 4157
=======================================
+ Hits 19604 19606 +2
Misses 676 676
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 251 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
|
Related Issue
Closes #6306
Fixes #6311