From 4d497e0053e192386168de714260e11d5f72a04e Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Thu, 29 Feb 2024 01:50:18 +0100 Subject: [PATCH] hacky workaround to allow __class_getitem__ with pydantic --- reflex/components/chakra/datadisplay/list.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reflex/components/chakra/datadisplay/list.py b/reflex/components/chakra/datadisplay/list.py index 4c78b56e3..5ae03989c 100644 --- a/reflex/components/chakra/datadisplay/list.py +++ b/reflex/components/chakra/datadisplay/list.py @@ -6,9 +6,12 @@ from reflex.components.chakra import ChakraComponent from reflex.components.component import Component from reflex.components.core.foreach import Foreach from reflex.vars import Var +from typing import TypeVar, Generic +T = TypeVar("T") -class List(ChakraComponent): +# TODO: Generic is just a hacky workaround to stop pydantic from complaining +class List(ChakraComponent, Generic[T]): """Display a list of items.""" tag = "List"