UNPKG

493 BTypeScriptView Raw
1import { EffectCallback } from 'react';
2/**
3 * Run's an effect on mount, and is cleaned up on unmount. Generally
4 * useful for interop with non-react plugins or components
5 *
6 * ```ts
7 * useMountEffect(() => {
8 * const plugin = $.myPlugin(ref.current)
9 *
10 * return () => {
11 * plugin.destroy()
12 * }
13 * })
14 * ```
15 * @param effect An effect to run on mount
16 *
17 * @category effects
18 */
19declare function useMountEffect(effect: EffectCallback): void;
20export default useMountEffect;