Ver código fonte

hacky workaround to allow __class_getitem__ with pydantic

Benedikt Bartscher 1 ano atrás
pai
commit
4d497e0053
1 arquivos alterados com 4 adições e 1 exclusões
  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"