---
url: "https://vueda.dev/v3/reference/api/js/use/useLeaveUnload/functions/useLeaveUnload.md"
title: "useLeaveUnload"
---

# useLeaveUnload

## Overview

A hook that listens for route changes and warns the user if they have unsaved changes.

## Signature

`useLeaveUnload(props)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-props">props</span> | `any` | yes | The reactive state to condition the unsaved  changes popup on. |

### Returns

`void`

## Source

`client/lib/use/useLeaveUnload.js:28`
