Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"props.groupComponent is undefined" error #3014

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading