Skip to content

Commit

Permalink
fix: don't render chart without width or height
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonehrman committed Jan 14, 2024
1 parent 4705620 commit ecbd7f4
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function Chart<TDatum extends Datum>({
// Prevent chart errors from crashing entire UI
<ParentSize>
{({ width, height }) => {
if (!width || !height || width <= 0 || height <= 0) return null
return (
// Set to relative for error boundary overlay
<div className="relative w-full h-full">
Expand Down

0 comments on commit ecbd7f4

Please sign in to comment.