Skip to content

Commit e04bfbb

Browse files
hjpradhami3310
andauthored
Added param context to add_page for extended functionality for plugins, flows, etc. (#5091)
* Added param context to add_page. * pre-commit --------- Co-authored-by: Khaleel Al-Adhami <[email protected]>
1 parent ddb81fe commit e04bfbb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

reflex/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ class UnevaluatedPage:
293293
image: str
294294
on_load: EventType[()] | None
295295
meta: list[dict[str, str]]
296+
context: dict[str, Any] | None
296297

297298

298299
@dataclasses.dataclass()
@@ -681,6 +682,7 @@ def add_page(
681682
image: str = constants.DefaultPage.IMAGE,
682683
on_load: EventType[()] | None = None,
683684
meta: list[dict[str, str]] = constants.DefaultPage.META_LIST,
685+
context: dict[str, Any] | None = None,
684686
):
685687
"""Add a page to the app.
686688
@@ -695,6 +697,7 @@ def add_page(
695697
image: The image to display on the page.
696698
on_load: The event handler(s) that will be called each time the page load.
697699
meta: The metadata of the page.
700+
context: Values passed to page for custom page-specific logic.
698701
699702
Raises:
700703
PageValueError: When the component is not set for a non-404 page.
@@ -762,6 +765,7 @@ def add_page(
762765
image=image,
763766
on_load=on_load,
764767
meta=meta,
768+
context=context,
765769
)
766770

767771
def _compile_page(self, route: str, save_page: bool = True):

0 commit comments

Comments
 (0)