浏览代码

Fix custom component render (#517)

Nikhil Rao 2 年之前
父节点
当前提交
29d46facb1
共有 1 个文件被更改,包括 8 次插入0 次删除
  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.