useDidUpdate ​
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
Name | Type | Default | Note |
---|---|---|---|
effect | EffectCallback | - | The effect callback |
deps? | DependencyList | - | The dependencies list for the effect |