From 422ede23b5f92e837073ac065fbc311fa9120c59 Mon Sep 17 00:00:00 2001 From: Jakob Norlin Date: Fri, 14 Nov 2025 08:46:33 +0100 Subject: [PATCH] Wrap init call in requestAnimationFrame This prevents issues with rendering charts under a Suspense boundary in Tanstack Router. --- src/chart.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/chart.tsx b/src/chart.tsx index 55a6c52..3ecc13f 100644 --- a/src/chart.tsx +++ b/src/chart.tsx @@ -43,7 +43,9 @@ export default function DefaultChart(props: ChartProps) { } onMount(() => { - init() + requestAnimationFrame(() => { + init() + }) }) createEffect(