Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 483 Bytes

use-mounted.mdx

File metadata and controls

27 lines (20 loc) · 483 Bytes

import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';

export default Layout(MDX_DATA.useMounted);

Usage

useMounted hook returns true if component is mounted and false if it's not.

import { useMounted } from '@mantine/hooks';

function Demo() {
  const mounted = useMounted();
  return (
    <div>
      {mounted ? 'Component is mounted' : 'Component is not mounted'}
    </div>
  );
}

Definition

function useMounted(): boolean;