---
schema_version: "1"
id: aa6c38fe20d47a50b41fa0bb4892a7e5f838e52afc76bb57e49b537f4168a315
title: RouteDestination
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lwr-node/lwr/references/csr-reference/routedestination.md
canonical_url: https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedestination.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: eb7e96912affcca2d24a1bcbd8267b7add84c5f59553d524171dd38903eee41a
products:
  - Lightning Web Runtime
---
# RouteDestination

`RouteDestination` contains a [`ViewSet`](#viewset) object. [`RouteHandler.new()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/new.md) takes a `RouteHandlerCallback` containing a `RouteDestination`. [`RouteHandler.update()`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/update.md) takes a `RouteHandlerCallback` containing a `RouteDestination`.

## Syntax

```javascript
type RouteDestination {
    viewset: ViewSet;
}
```

## Properties

| Property  | Type               | Required/Optional | Description                                            |
| --------- | ------------------ | ----------------- | ------------------------------------------------------ |
| `viewset` | A `ViewSet` object | Required          | A `ViewSet` object that specifies the view to display. |

## ViewSet

The view to display. Supply a `ViewSet` object to a [`RouteDestination`](https://developer.salesforce.com/docs/platform/lwr/references/csr-reference/routedestination.md).

### Properties

| Property   | Type   | Required/Optional | Description                                                                                                                                                                                                                                                                     |
| ---------- | ------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `viewName` | String | Required          | The `viewName` key maps to the `viewName` property for the [`outlet`](https://developer.salesforce.com/docs/platform/lwr/guides/lwr-outlets.md). It accepts **either**: <ul><li>a Promise to a route handler module: `{ default: import('my/routeHandler') }`.</li><li>a [`ViewInfo` object](#viewinfo)</li></ul></li></ul> |

**note:** In LWR, modules are always provided via a Promise object. Promises allow the module code to be lazily loaded, improving application performance.

### Syntax

```javascript
interface ViewSet {
    [viewName: string]: (() => Promise<Module>) | ViewInfo;
}
```

**note:** If a single page reference maps to more than one view, you can specify more than one outlet where each outputs a different view component. For example: `{ default: import('my/routeHandler'), sidebar: import('my/sideHandler'), footer: import('my/footerHandler') }`. Check out [Outlets](https://developer.salesforce.com/docs/platform/lwr/guides/lwr-outlets.md) for more information about using multiple outlets.

## ViewInfo

An object containing a Promise to a route handler module and a string specifier for the module. Supply a `ViewInfo` object to a [`ViewSet` object](#viewset).

### Properties

| Property | Type    | Required/Optional | Description                                                                                                                                                                                                                                                                                                 |
| -------- | ------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `module` | Promise | Required          | A promise to a route handler module.                                                                                                                                                                                                                                                                        |
| `string` | String  | Required          | A string specifier for the module, like `my/recipePage`. Simple or straightforward use cases typically don't require a specifier. In other cases, the specifier for the module can't be determined from a Promise alone, so you should manually define the module's string specifier for the route handler. |

### Syntax

```javascript
interface ViewInfo {
    module: () => Promise<Module>
    specifier: string;
}
```

**See Also**

- [Route Handler Modules](https://developer.salesforce.com/docs/platform/lwr/guides/lwr-route-handler-modules.md#routehandlercallback-and-routedestination)
