UNPKG

@hooks/mount

Version:

React hook to execute callback on component mount

5 lines (4 loc) 131 B
import { useEffect } from 'react'; export default function useMount(callback, hook = useEffect) { return hook(callback, []); }