diff --git a/reflex/app.py b/reflex/app.py index f8f1a63ef76..8af7cb19f43 100644 --- a/reflex/app.py +++ b/reflex/app.py @@ -1117,7 +1117,6 @@ def _apply_decorated_pages(self): # Add the @rx.page decorated pages to collect on_load events. for render, kwargs in DECORATED_PAGES[app_name]: self.add_page(render, **kwargs) - DECORATED_PAGES[app_name].clear() def _validate_var_dependencies(self, state: type[BaseState] | None = None) -> None: """Validate the dependencies of the vars in the app. diff --git a/reflex/page.py b/reflex/page.py index 030a8373f75..ff833aa27ed 100644 --- a/reflex/page.py +++ b/reflex/page.py @@ -8,6 +8,7 @@ from reflex.config import get_config from reflex.event import EventType +from reflex.utils import console DECORATED_PAGES: dict[str, list] = defaultdict(list) @@ -76,6 +77,13 @@ def get_decorated_pages(omit_implicit_routes: bool = True) -> list[dict[str, Any Returns: The decorated pages. """ + console.deprecate( + "get_decorated_pages", + reason="This function is deprecated and will be removed in a future version.", + deprecation_version="0.7.9", + removal_version="0.8.0", + dedupe=True, + ) return sorted( [ page_data