Skip to content

Commit

Permalink
feat(core): Prism support undefined children
Browse files Browse the repository at this point in the history
  • Loading branch information
vaynevayne authored Sep 5, 2023
1 parent 9e5db0c commit bb5b028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mantine-prism/src/Prism/Prism.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const Prism = forwardRef<HTMLDivElement, PrismProps>((props: PrismProps,
...others
} = useComponentDefaultProps('Prism', prismDefaultProps, props);
const code = trim && typeof children === 'string' ? children.trim() : children;
const maxLineSize = code.split('\n').length.toString().length;
const maxLineSize = code?.split('\n').length.toString().length || 0;

const theme = useMantineTheme();
const clipboard = useClipboard();
Expand Down

0 comments on commit bb5b028

Please sign in to comment.