When providing a rendering function to the Pie component label prop, the function accepts props of type PieLabelRenderProps.
For example:
const RenderLabel = ({ x, y }: PieLabelRenderProps) => (
<text x={x} y={y} className="customized-label">
test
</text>
);
The problem is with some of the keys available, their types are resolved as unknown, making type guards or casting a requirement if you want to perform any business logic using the props.
It's also not very intuitive to access them, since autocomplete doesn't suggest them automatically.
If PieLabelRenderProps were to more accurately identify the types of values returned it would be a helpful improvement.
When providing a rendering function to the
Piecomponentlabelprop, the function accepts props of typePieLabelRenderProps.For example:
The problem is with some of the keys available, their types are resolved as
unknown, making type guards or casting a requirement if you want to perform any business logic using the props.It's also not very intuitive to access them, since autocomplete doesn't suggest them automatically.
If
PieLabelRenderPropswere to more accurately identify the types of values returned it would be a helpful improvement.