Skip to content

useDidUpdate ​

Hook that triggers the effect callback on updates

lifecycle
test coverage
Last changed: last month

Installation ​

Library
CLI
Manual
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

Type declaration ​

typescript
import type { DependencyList, EffectCallback } from 'react';

Source ​

Source • Demo

Contributors ​

D
debabin
debabin
E
Erik
Erik
H
hywax
hywax
W
wmoooid
wmoooid

Released under the MIT License.