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

***

# Function: usePrevious()

> **usePrevious**\<`T`\>(`value`, `initialDefault`?): `T`

Always returns the value that was defined during the previous render,
storing the current value for the next render

## Type parameters

• **T**

## Parameters

• **value**: `T`

Value

• **initialDefault?**: `T`

Value at mount time.

## Returns

`T`

## Function

usePrevious

## Source

[hooks/usePrevious.js:13](https://github.com/Twipped/hooks/blob/main/hooks/usePrevious.js#L13)
