useDidUpdate ​
Hook that triggers the effect callback on updates
lifecycle
necessary
test coverage
Last changed: 3 months ago
Installation ​
Library
CLI
Manual
typescript
import { useDidUpdate } from '@siberiacancode/reactuse';Usage ​
typescript
useDidUpdate(() => console.log("effect runs on updates"), deps);Demo ​
Api ​
Parameters
| Name | Type | Default | Note |
|---|---|---|---|
| effect | EffectCallback | - | The effect callback |
| deps? | DependencyList | - | The dependencies list for the effect |
Type declaration ​
typescript
import type { DependencyList, EffectCallback } from 'react';Source ​
Source • DemoContributors ​
D
E
H
W