createRouter()

Creates and initializes an LWR router.

Properties 

Method InputTypeRequired/OptionalDescription
configRouterConfig objectOptionalPass in the RouterConfig object you want to create a router for. If you don’t specify a RouterConfig, LWR creates a router with default values.

We recommend that you specify a RouterConfig for createRouter(). If you don’t pass in a value for RouterConfig.routes, the router can’t match any locations.

Note

Syntax 

1import { createRouter } from 'lwr/router';
2
3createRouter(config?: RouterConfig
4    ): Router<PageReference>

Returns 

See Also

Developer Preview Feature

Feature is available as a developer preview. Feature is not generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Do not implement functionality developed with these commands or tools.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!