---
title: "updateUrl"
source: "https://github.com/remix-run/remix/blob/main/packages/component/src/runtime/update-url.ts#L36"
---

# updateUrl

## Summary

Reflects locally rendered state in the URL without fetching, rendering, or changing scroll/focus.
Preserves history state and synchronizes Remix metadata and the top-frame source.
Waits for the active transition and requires the captured browser URL to remain current.
Supersession, navigation/URL changes, and cancellation resolve with an aborted signal.
Newer calls supersede waiting calls. Cancellation reasons are available on the returned signal.
Native interception of this update is unsupported (`NotSupportedError`); it may still commit.
Cross-origin URLs reject with `SecurityError`; other failures propagate.
Do not await this inside the captured transition's interception handler.

## Signature

```ts
function updateUrl(href: string, options: UpdateUrlOptions): Promise<AbortSignal>

```

## Parameters

### `href`

Same-origin URL, resolved against `document.baseURI` when applied. An empty string
retains the current URL.

### `options`

History mode (default: `"replace"`) and cancellation signal.

## Returns

The update's signal: aborted on cancellation, otherwise permanently non-aborted.