Here's the warning:
Warning: Unknown props `lineHeight`, `events`, `slice`, `text`, `index`, `datum`, `verticalAnchor`, `angle` on <text> tag.
Do you know how I could filter these props?
I'm getting similar warnings for <VictoryGroup>:
Warning: Unknown props `parent`, `events` on <g> tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop
in g
in VictorySharedEvents (created by VictoryGroup)
in VictoryGroup (created by VictoryChart)
in g
in svg (created by VictoryContainer)
in VictoryContainer (created by VictoryChart)
in VictoryChart (created by MyOwnGraphComponent)
I think the simplest way would be to just check if the default element is being used (like the <g> in case of VictorySharedEvents set in defaultProps), and filter out all the superfluous props.
Something like:
getContainer(props, children) {
...
if (!this.props.container) {
usingDefaultComponent = true;
}
const container = this.props.container || this.props.groupComponent;
...
return React.cloneElement(
container,
assign(
{}, parentProps, usingDefaultComponent ? {} : {events: Events.getPartialEvents(parentEvents, "parent", parentProps)}
),
children
);
}
Most helpful comment
I'm getting similar warnings for
<VictoryGroup>: