Skip to content

useDidUpdate ​

lifecycle
test coverage
Last changed: 5 days ago

Hook that triggers the effect callback on updates

typescript
import { useDidUpdate } from '@siberiacancode/reactuse';

Usage ​

typescript
useDidUpdate(() => console.log("effect runs on updates"), deps);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
effectEffectCallback-The effect callback
deps?DependencyList-The dependencies list for the effect

Source ​

Source • Demo

Contributors ​

AvatarErik
Avatardebabin
Avatarhywax
Avatarwmoooid

Released under the MIT License.