From 45071bc8678f1a5227dea9d7040d3bbe4a457c08 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Mon, 4 Nov 2024 09:35:40 -0800 Subject: [PATCH] special case field in _isinstance --- reflex/utils/types.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index d58825ed55c..bcb52464a18 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -570,6 +570,12 @@ def _isinstance(obj: Any, cls: GenericType, nested: bool = False) -> bool: _isinstance(item, args[0]) for item in obj ) + if args: + from reflex.vars import Field + + if origin is Field: + return _isinstance(obj, args[0]) + return isinstance(obj, get_base_class(cls))