[**@twipped/hooks**](../../README.md) • **Docs**

***

# Function: useWhenElementRefReady()

> **useWhenElementRefReady**\<`T`\>(`ref`, `onResolved`?): `any`

Executes the passed function once the provided Ref resolves to a value.

## Type parameters

• **T** *extends* `HTMLElement`

## Parameters

• **ref**: `T` \| `MutableRefObject`\<`T`\>

Ref

• **onResolved?**

Callback to invoke with the ref resolves

## Returns

`any`

## Function

useWhenElementRefReady

## Source

[hooks/useWhenElementRefReady.js:15](https://github.com/Twipped/hooks/blob/main/hooks/useWhenElementRefReady.js#L15)
