---
url: https://lit-ui-router.dev/reference/lit-ui-router/core/getScopedRouter.md
---
[lit-ui-router](../index.md) / getScopedRouter

# Variable: getScopedRouter

```ts
const getScopedRouter: () => 
  | UIRouter
  | undefined;
```

Defined in: [packages/lit-ui-router/src/context.ts:518](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/context.ts#L518)

Returns the router the innermost enclosing
[\`withRouterSync\`](withRouterSync.md) call scoped, or `undefined`
outside one.

## Returns

| [`UIRouter`](https://ui-router.github.io/core/docs/latest/classes/_router_.uirouter.html)
| `undefined`
