Skip to content

Commit

Permalink
fixed typing for addEvents.renderData, moved bar shouldRenderDatum ar…
Browse files Browse the repository at this point in the history
…gument to static property
  • Loading branch information
nstolpe committed Nov 15, 2024
1 parent d84155d commit 7839bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/victory-bar/src/victory-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ class VictoryBarBase extends React.Component<VictoryBarProps> {
"groupComponent",
"containerComponent",
];

// passed to addEvents.renderData to prevent data props with undefined _x or _y from excluding data from render.
// used when inside of VictoryZoomContainer
static shouldRenderDatum = () => true;
// Overridden in native versions
shouldAnimate() {
return !!this.props.animate;
Expand All @@ -144,7 +146,7 @@ class VictoryBarBase extends React.Component<VictoryBarProps> {

let children;
if (props.groupComponent.type === VictoryClipContainer) {
children = this.renderData(props, () => true);
children = this.renderData(props, VictoryBarBase.shouldRenderDatum);
} else {
children = this.renderData(props);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-core/src/victory-util/add-events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface EventsMixinClass<TProps> {
): React.ReactElement;
cacheValues<TThis>(this: TThis, obj: Partial<TThis>): void;
getEventState: typeof Events.getEventState;
renderData(props: TProps);
renderData(props: TProps, shouldRenderDatum?: () => boolean);
renderContinuousData(props: TProps);
animateComponent(
props: TProps,
Expand Down

0 comments on commit 7839bdb

Please sign in to comment.