Skip to content

Commit

Permalink
compare class directly instead of displayName
Browse files Browse the repository at this point in the history
  • Loading branch information
nstolpe committed Nov 15, 2024
1 parent 890f746 commit d84155d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/victory-bar/src/helper-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Helpers,
LabelHelpers,
Scale,
VictoryClipContainer
} from "victory-core";

export const getBarPosition = (props, datum) => {
Expand Down Expand Up @@ -61,7 +62,7 @@ const getCalculatedValues = (props) => {
let data = Data.getData(props);
data = Data.formatDataFromDomain(data, domain, 0);

if (props.groupComponent.type.displayName === 'VictoryClipContainer') {
if (props.groupComponent.type === VictoryClipContainer) {
data = data.map((datum) => {
datum._x = datum.x;
datum._y = datum.y;
Expand Down
3 changes: 2 additions & 1 deletion packages/victory-bar/src/victory-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EventPropTypeInterface,
NumberOrCallback,
StringOrNumberOrCallback,
VictoryClipContainer,
VictoryCommonProps,
VictoryDatableProps,
VictoryMultiLabelableProps,
Expand Down Expand Up @@ -142,7 +143,7 @@ class VictoryBarBase extends React.Component<VictoryBarProps> {
}

let children;
if (props.groupComponent.type.displayName === 'VictoryClipContainer') {
if (props.groupComponent.type === VictoryClipContainer) {
children = this.renderData(props, () => true);
} else {
children = this.renderData(props);
Expand Down

0 comments on commit d84155d

Please sign in to comment.