浏览代码

add style recursive for memo (#5380)

Khaleel Al-Adhami 3 天之前
父节点
当前提交
d3396dbf33
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      reflex/components/component.py

+ 11 - 1
reflex/components/component.py

@@ -2194,7 +2194,17 @@ class CustomComponent(Component):
         Returns:
             The code to render the component.
         """
-        return self.component_fn(*self.get_prop_vars())
+        component = self.component_fn(*self.get_prop_vars())
+
+        try:
+            from reflex.utils.prerequisites import get_and_validate_app
+
+            style = get_and_validate_app().app.style
+        except Exception:
+            style = {}
+
+        component._add_style_recursive(style)
+        return component
 
 
 CUSTOM_COMPONENTS: dict[str, CustomComponent] = {}