App
reflex.app.App
The main Reflex app that encapsulates the backend and frontend.
Every Reflex app needs an app defined in its main module.
Methods
Signature | Description |
---|---|
frontend_exception_handler(exception: 'Exception') -> 'None' | Default frontend exception handler function. |
backend_exception_handler(exception: 'Exception') -> 'EventSpec' | Default backend exception handler function. |
add_page(self, component: 'Component | ComponentCallable | None' = None, route: 'str | None' = None, title: 'str | Var | None' = None, description: 'str | Var | None' = None, image: 'str' = 'favicon.ico', on_load: 'EventType[()] | None' = None, meta: 'list[dict[str, str]]' = [], context: 'dict[str, Any] | None' = None) | Add a page to the app. If the component is a callable, by default the route is the name of the function. Otherwise, a route must be provided. |
get_load_events(self, path: 'str') -> 'list[IndividualEventType[()]]' | Get the load events for a route. |
add_all_routes_endpoint(self) | Add an endpoint to the app that returns all the routes. |
modify_state(self, token: 'str') -> 'AsyncIterator[BaseState]' | Modify the state out of band. |