Skip to content

Commit

Permalink
Remove deprecated route decorator (#1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahAhianyo authored Sep 14, 2023
1 parent b378827 commit 796f523
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 46 deletions.
1 change: 0 additions & 1 deletion reflex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from .model import Model as Model
from .model import session as session
from .page import page as page
from .route import route as route
from .state import ComputedVar as var
from .state import Cookie as Cookie
from .state import LocalStorage as LocalStorage
Expand Down
45 changes: 0 additions & 45 deletions reflex/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,6 @@
import re

from reflex import constants
from reflex.event import EventHandler
from reflex.page import page
from reflex.utils.console import deprecate


def route(
route: str | None = None,
title: str | None = None,
image: str | None = None,
description: str | None = None,
on_load: EventHandler | list[EventHandler] | None = None,
):
"""Decorate a function as a page.
rx.App() will automatically call add_page() for any method decorated with route
when App.compile is called.
All defaults are None because they will use the one from add_page().
Note: the decorated functions still need to be imported.
Args:
route: The route to reach the page.
title: The title of the page.
image: The favicon of the page.
description: The description of the page
on_load: The event handler(s) called when the page load.
Returns:
The decorated function.
"""
deprecate(
feature_name="@rx.route",
deprecation_version="0.2.3",
reason="and is being replaced by @rx.page due to enhanced routing features.",
removal_version="0.2.8",
)

return page(
route=route,
title=title,
image=image,
description=description,
on_load=on_load,
)


def verify_route_validity(route: str) -> None:
Expand Down

0 comments on commit 796f523

Please sign in to comment.