Skip to content

Commit

Permalink
"props.groupComponent is undefined" error (#3014)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq authored Dec 19, 2024
1 parent 27e2ce2 commit 3ce810f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-comics-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"victory-bar": patch
---

Fix "props.groupComponent is undefined" error
2 changes: 1 addition & 1 deletion packages/victory-bar/src/helper-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const getCalculatedValues = (props) => {

// when inside a zoom container, reset the _x and _y properties of each datum to the original
// x and y property values so they will not be clipped. See https://github.com/FormidableLabs/victory/pull/2970
if (props.groupComponent.type === VictoryClipContainer) {
if (props.groupComponent?.type === VictoryClipContainer) {
data = data.map((datum) => ({ ...datum, _x: datum.x, _y: datum.y }));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/victory-bar/src/victory-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class VictoryBarBase extends React.Component<VictoryBarProps> {
// when inside a zoom container (the only place VictoryClipContainer is used), all data
// should be renderable so bars won't dissappear before they've fully exited the container's bounds
// see https://github.com/FormidableLabs/victory/pull/2970
if (props.groupComponent.type === VictoryClipContainer) {
if (props.groupComponent?.type === VictoryClipContainer) {
children = this.renderData(props, VictoryBarBase.shouldRenderDatum);
} else {
children = this.renderData(props);
Expand Down

0 comments on commit 3ce810f

Please sign in to comment.