Skip to content

Commit a5e77f2

Browse files
committed
add style recursive for memo (#5380)
1 parent 8813bcc commit a5e77f2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

reflex/components/component.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,17 @@ def get_component(self) -> Component:
21942194
Returns:
21952195
The code to render the component.
21962196
"""
2197-
return self.component_fn(*self.get_prop_vars())
2197+
component = self.component_fn(*self.get_prop_vars())
2198+
2199+
try:
2200+
from reflex.utils.prerequisites import get_and_validate_app
2201+
2202+
style = get_and_validate_app().app.style
2203+
except Exception:
2204+
style = {}
2205+
2206+
component._add_style_recursive(style)
2207+
return component
21982208

21992209

22002210
CUSTOM_COMPONENTS: dict[str, CustomComponent] = {}

0 commit comments

Comments
 (0)