createRouter()
Creates and initializes an LWR router.
Method Input | Type | Required/Optional | Description |
---|---|---|---|
config | RouterConfig object | Optional | Pass 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.
- A router object that you can pass to a router container component.
See Also