Skip to content

useMount

Category
Export Size
99 B
Last Changed
5 days ago

Runs a callback once after the component mounts.

Demo

Usage

tsx
import { 
useMount
} from '@reause/shared'
useMount
(() => {
console
.
log
('mounted')
})

Type Declarations

ts
export function useMount(fn: () => void): void

Source

Source · Demo · react-use

Contributors

hairyf

Changelog

v0.1.6 on
5f696 - feat(shared): add useEffectOnce (#919)
v0.1.0 on
01b33 - fix(shared): resolve useMount audit findings (#736)

Released under the MIT License. v0.1.8