# new()

Creates a route handler module.

:::note
[Route handler **modules**](/docs/platform/lwr/guide/lwr-route-handler-modules.md), which are used in client-side routing, aren’t the same as [route handler **functions**](/docs/platform/lwr/guide/lwr-routing-server.md#route-handler-functions), which are used in server-side routing.
:::

## Properties

| Method Input | Type                            | Required/Optional | Description                                                                                                                                                                                                                                                                                                                                                                              |
| ------------ | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `callback`   | `RouteHandlerCallback` function | Required          | A reference to a route handler callback. Each `RouteHandlerCallback` takes a [`RouteDestination`](/docs/platform/lwr/references/csr-reference/routedestination.md) object. Make sure to save the reference to this callback. [`RouteHandler.update`](/docs/platform/lwr/references/csr-reference/update.md) invokes the callback to return the `ViewSet` for a given `RouteDestination`. |

## Syntax

```javascript
constructor(callback: RouteHandlerCallback) {
        this.callback = callback; // Important: maintain a reference to the callback
    }
```

## Signature

```javascript
public void new(callback: RouteHandlerCallback)
```

## Returns

- None

**See Also**

- [Route Handler Modules](/docs/platform/lwr/guide/lwr-route-handler-modules.md#new)
- [Simple Routing Example: Create a Route Handler](/docs/platform/lwr/guide/lwr-routing-example-simple.md#create-a-route-handler)
