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.
Installation
Open inpnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareLayoutEffect.jsonnpx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareLayoutEffect.jsonyarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareLayoutEffect.jsonbun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useDeepCompareLayoutEffect.jsonUsage is the same as useLayoutEffect, but deps are compared with react-fast-compare.
Examples
Default usage
API
useDeepCompareLayoutEffect(
effect: React.EffectCallback,
deps: React.DependencyList
);