From 84ad2213946281117396556d6843f8804524b754 Mon Sep 17 00:00:00 2001 From: Shahmir Varqha Date: Thu, 14 Nov 2024 09:00:36 +0800 Subject: [PATCH] only trigger rerender when ready --- frontend/src/plugins/impl/plotly/PlotlyPlugin.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/plugins/impl/plotly/PlotlyPlugin.tsx b/frontend/src/plugins/impl/plotly/PlotlyPlugin.tsx index 0996f52b396..f1af33b4d5e 100644 --- a/frontend/src/plugins/impl/plotly/PlotlyPlugin.tsx +++ b/frontend/src/plugins/impl/plotly/PlotlyPlugin.tsx @@ -111,9 +111,10 @@ export const PlotlyComponent = memo( }); // Used for rendering LaTeX. TODO: Serve this library from Marimo - const isScriptLoaded = useScript( + const scriptStatus = useScript( "https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-MML-AM_CHTML", ); + const isScriptLoaded = scriptStatus === "ready"; useEffect(() => { const nextFigure = structuredClone(originalFigure);