UNPKG
@hooks/mount
Version:
latest (0.1.0)
0.1.0
React hook to execute callback on component mount
@hooks/mount
/
esm
/
index.js
5 lines
(4 loc)
•
131 B
JavaScript
View Raw
1
2
3
4
5
import
{ useEffect }
from
'react'
;
export
default
function
useMount
(
callback, hook = useEffect
) {
return
hook
(callback, []); }