From 85ea670ce9bcd42659f73c52a7c928e8c243b113 Mon Sep 17 00:00:00 2001 From: "Maarten A. Breddels" Date: Wed, 22 Nov 2023 20:14:25 +0100 Subject: [PATCH] refactor: avoid 'flash' during hydration. This seems to be due to hydration and CSS animation. --- solara/server/templates/solara.html.j2 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/solara/server/templates/solara.html.j2 b/solara/server/templates/solara.html.j2 index 99377c98a..f97ba8800 100644 --- a/solara/server/templates/solara.html.j2 +++ b/solara/server/templates/solara.html.j2 @@ -49,6 +49,10 @@ {% endblock header %} @@ -339,7 +343,11 @@ // so we mount it when loading becomes false if (solara.preRendered && !this.mounted) { this.isMounted = true; - this.$mount("#app") + document.body.classList.add('solara-disable-animations'); + this.$mount("#app"); + setTimeout(() => { + document.body.classList.remove('solara-disable-animations'); + }, 1000); } else { this.isMounted = true; }