Skip to Content
ohooks

usePrevious

Returns the value passed on the previous render.

Loading preview...

The usePrevious hook returns the value from the immediately preceding render pass (undefined on the initial render).

Installation

pnpm dlx shadcn@latest add https://ohooks.vercel.app/r/usePrevious.json

Usage