Skip to content

useUpdateEffect

Category
Export Size
161 B
Last Changed
5 days ago

useEffect that skips the first render.

Demo

Usage

tsx
import { 
useUpdateEffect
} from '@reause/shared'
useUpdateEffect
(() => {
console
.
log
('count changed, but not on mount')
}, [count])

Type Declarations

ts
export function useUpdateEffect(effect: EffectCallback, deps?: DependencyList): void

Source

Source · Demo · react-use

Contributors

hairyf

Changelog

v0.1.7 on
8ade2 - feat(shared): add useIsFirstRender (#940)
v0.1.6 on
eaab6 - feat(shared): add useUpdateEffect (#920)

Released under the MIT License. v0.1.8