app.screen
The screen method is used to define a route that is responsible for displaying screens in the application. This method allows developers to create routes that generate user interfaces (UI) based on specific templates and data.
Method Signature
screen<Handler extends ScreenRouteHandlerFn>(
pattern: string,
handler: Handler
): GetRouteRef<GetReturnTypeOfHandler<Handler>>
Parameters
-
pattern:
string
The route path, which can be fixed or contain parameters. -
handler:
ScreenRouteHandlerFn
A handler function that is called when the route is accessed. This function generates the content to be displayed on the screen.
Return Value
GetRouteRef
An object representing a reference to the created route. This object includes methods and properties for managing the route.
Properties of GetRouteRef
-
pattern:
string
The route template. -
handlerFn:
RouteRefHandlerFn
The handler function for the route. -
needParams:
boolean | null
An optional flag indicating whether parameters are required. -
routerUrlPath:
string | null
An optional URL path for the route. -
accountUrl:
AccountUrlFn
A function that returns the account URL.