---
id: fast-element.ref
title: ref() function
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-element](./fast-element.md) &gt; [ref](./fast-element.ref.md)

## ref() function

A directive that observes the updates a property with a reference to the element.

<b>Signature:</b>

```typescript
export declare function ref<T = any>(propertyName: keyof T & string): CaptureType<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  propertyName | keyof T &amp; string | The name of the property to assign the reference to. |

<b>Returns:</b>

[CaptureType](./fast-element.capturetype.md)<!-- -->&lt;T&gt;
