UNPKG
@hooks/mount
Version:
latest (0.1.0)
0.1.0
React hook to execute callback on component mount
@hooks/mount
/
cjs
/
index.js
8 lines
(7 loc)
•
228 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
const
react_1 =
require
(
"react"
);
function
useMount
(
callback, hook = react_1.useEffect
) {
return
hook
(callback, []); }
exports
.
default
= useMount;