From 0314d19e7eda4c1bbe6125112463bcdf08dd3892 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 25 Jun 2024 06:20:04 -0700 Subject: [PATCH] Ensure rx.match gets memoized to avoid excessive re-rendering (#3552) --- reflex/components/component.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reflex/components/component.py b/reflex/components/component.py index cc212bf9a..cb2396e75 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -2038,6 +2038,7 @@ class StatefulComponent(BaseComponent): from reflex.components.base.bare import Bare from reflex.components.core.cond import Cond from reflex.components.core.foreach import Foreach + from reflex.components.core.match import Match if isinstance(child, Bare): return child.contents @@ -2045,6 +2046,8 @@ class StatefulComponent(BaseComponent): return child.cond if isinstance(child, Foreach): return child.iterable + if isinstance(child, Match): + return child.cond return child @classmethod