hacky workaround to allow __class_getitem__ with pydantic

This commit is contained in:
Benedikt Bartscher 2024-02-29 01:50:18 +01:00
parent 1abc57c68b
commit 4d497e0053
No known key found for this signature in database

View File

@ -6,9 +6,12 @@ from reflex.components.chakra import ChakraComponent
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.core.foreach import Foreach from reflex.components.core.foreach import Foreach
from reflex.vars import Var 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.""" """Display a list of items."""
tag = "List" tag = "List"