useMountEffect
API
import useMountEffect from '@restart/hooks/useMountEffect'
useMountEffect
(effect: EffectCallback) => voidRun's an effect on mount, and is cleaned up on unmount. Generally useful for interop with non-react plugins or components
useMountEffect(() => {const plugin = $.myPlugin(ref.current)return () => {plugin.destroy()}})Parameters
effect
EffectCallbackAn effect to run on mount
Return Value void