Skip to content

useMounted

Category
Export Size
140 B
Last Changed
5 days ago

Mounted state in ref.

Demo

Usage

tsx
import { 
useMounted
} from '@reause/core'
const
isMounted
=
useMounted
() // boolean
// starts `false`, flips to `true` in a mount effect — stays `false` during SSR/hydration

Type Declarations

ts
export function useMounted(): boolean

Source

Source · Demo · VueUse

Contributors

hairyf

Changelog

v0.1.7 on
55501 - feat(shared): add useUnmountedRef (#943)
v0.1.0 on
7a39c - fix(core): resolve useMounted audit findings (#602)

Released under the MIT License. v0.1.8