useUnMount

Run a function when component is unmounted.

Usage

import { useUnMount } from '@react-hooks-library/core'

function Demo() {
  useUnMount(() => {
    alert('I have been unMounted')
  })

  return <div></div>
}

Type Declarations

/**
 * Run a function when component is unmounted.
 *
 * @param callback function to be executed
 */
declare function useUnMount(func: Fn): void;

Source

Source | Demo | Docs