Explorar o código

Fix custom component render (#517)

Nikhil Rao %!s(int64=2) %!d(string=hai) anos
pai
achega
29d46facb1
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      pynecone/components/component.py

+ 8 - 0
pynecone/components/component.py

@@ -557,6 +557,14 @@ class CustomComponent(Component):
             custom_components |= self.get_component().get_custom_components(seen=seen)
         return custom_components
 
+    def _render(self) -> Tag:
+        """Define how to render the component in React.
+
+        Returns:
+            The tag to render.
+        """
+        return Tag(name=self.tag).add_props(**self.props)
+
     def get_prop_vars(self) -> List[BaseVar]:
         """Get the prop vars.