Skip to content

Commit cfe5686

Browse files
committed
fix: undefined case
1 parent c9c69c3 commit cfe5686

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/victory-core/src/victory-util/wrapper.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,10 @@ export function getStringsFromChildren(props, childComponents) {
437437
}
438438

439439
export function getCategories(props, childComponents, allStrings?) {
440-
const xPropCategories = Data.getStringsFromCategories(props, "x");
441-
const yPropCategories = Data.getStringsFromCategories(props, "y");
440+
const xPropCategories =
441+
props.categories && Data.getStringsFromCategories(props, "x");
442+
const yPropCategories =
443+
props.categories && Data.getStringsFromCategories(props, "y");
442444
const fallbackRequired = !xPropCategories || !yPropCategories;
443445

444446
const fallbackProps = fallbackRequired

0 commit comments

Comments
 (0)