Skip to content

useDidUpdate ​

Category
Lifecycle

Hook that behaves like useEffect, but skips the effect on the initial render

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

Usage ​

typescript
useDidUpdate(() => console.log('Won't be called when mounted'), [deps]);

Demo ​

Api ​

Parameters

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

Contributors ​

Source • Demo