mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 07:25:19 +02:00
fix: don't render chart without width or height
This commit is contained in:
parent
47056203d0
commit
ecbd7f427f
1 changed files with 1 additions and 0 deletions
|
@ -49,6 +49,7 @@ export function Chart<TDatum extends Datum>({
|
||||||
// Prevent chart errors from crashing entire UI
|
// Prevent chart errors from crashing entire UI
|
||||||
<ParentSize>
|
<ParentSize>
|
||||||
{({ width, height }) => {
|
{({ width, height }) => {
|
||||||
|
if (!width || !height || width <= 0 || height <= 0) return null
|
||||||
return (
|
return (
|
||||||
// Set to relative for error boundary overlay
|
// Set to relative for error boundary overlay
|
||||||
<div className="relative w-full h-full">
|
<div className="relative w-full h-full">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue