shadcn-ahooks

useDeepCompareEffect

Usage is the same as useEffect, but deps are compared with react-fast-compare.

Overview

Usage is the same as useEffect, but deps are compared with react-fast-compare.

Documentation and Examples

Installation

Open in
pnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareEffect.json
npx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareEffect.json
yarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareEffect.json
bun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareEffect.json

Usage is the same as useEffect, but deps are compared with react-fast-compare.

Examples

Default usage

API

useDeepCompareEffect(
  effect: React.EffectCallback,
  deps: React.DependencyList
);

On this page