Explorar o código

hacky workaround to allow __class_getitem__ with pydantic

Benedikt Bartscher hai 1 ano
pai
achega
4d497e0053
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      reflex/components/chakra/datadisplay/list.py

+ 4 - 1
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"