Skip to content

useMounted

Package
Share - Core
Category
Description
mounted state in ref

Mounted state in ref.

Usage

js
import { useMounted } from '@hungpvq/shared-core';

const isMounted = useMounted();

Which is essentially a shorthand of:

ts
const isMounted = ref(false);

onMounted(() => {
  isMounted.value = true;
});