diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py index ccb13c17b1a..98ce605d6d1 100644 --- a/reflex/components/core/cond.py +++ b/reflex/components/core/cond.py @@ -10,7 +10,7 @@ from reflex.constants import Dirs from reflex.style import LIGHT_COLOR_MODE, resolved_color_mode from reflex.utils.imports import ImportDict, ImportVar -from reflex.utils.types import safe_issubclass +from reflex.utils.types import infallible_issubclass from reflex.vars import VarData from reflex.vars.base import LiteralVar, ReflexCallable, Var from reflex.vars.function import ArgsFunctionOperation @@ -143,7 +143,7 @@ def cond(condition: Any, c1: Any, c2: Any = None) -> Component | Var: # If the first component is a component, create a Fragment if the second component is not set. if isinstance(c1, BaseComponent) or ( - isinstance(c1, Var) and safe_issubclass(c1._var_type, BaseComponent) + isinstance(c1, Var) and infallible_issubclass(c1._var_type, BaseComponent) ): c2 = c2 if c2 is not None else Fragment.create()