diff --git a/reflex/components/component.py b/reflex/components/component.py index 6f5721afd1b..66d286d2871 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -2194,7 +2194,17 @@ def get_component(self) -> 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] = {}