shadcn-ahooks

useDeepCompareLayoutEffect

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

Overview

Usage is the same as useLayoutEffect, 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/useDeepCompareLayoutEffect.json
npx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareLayoutEffect.json
yarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareLayoutEffect.json
bun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareLayoutEffect.json

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

Examples

Default usage

API

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

On this page