Przeglądaj źródła

add missing default values to icon and link

Benedikt Bartscher 1 rok temu
rodzic
commit
5c584da4ef

+ 3 - 1
reflex/components/lucide/icon.py

@@ -1,5 +1,7 @@
 """Lucide Icon component."""
 
+from typing import Optional
+
 from reflex.components.component import Component
 from reflex.style import Style
 from reflex.utils import format
@@ -18,7 +20,7 @@ class Icon(LucideIconComponent):
     tag = "None"
 
     # The size of the icon in pixels.
-    size: Var[int]
+    size: Optional[Var[int]] = None
 
     @classmethod
     def create(cls, *children, **props) -> Component:

+ 3 - 1
reflex/components/next/link.py

@@ -1,5 +1,7 @@
 """A link component."""
 
+from typing import Optional
+
 from reflex.components.component import Component
 from reflex.vars import Var
 
@@ -14,7 +16,7 @@ class NextLink(Component):
     is_default = True
 
     # The page to link to.
-    href: Var[str]
+    href: Optional[Var[str]] = None
 
     # Whether to pass the href prop to the child.
     pass_href: Var[bool] = True  # type: ignore