UNPKG
nusp-arco-design
Version:
latest (2.66.0-beta.2)
2.66.0-beta.2
Arco Design React UI Library.
arco.design
zhanghui-space/arco-design
nusp-arco-design
/
es
/
_util
/
hooks
/
useCreate.js
9 lines
(8 loc)
•
220 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
*
as
React
from
'react'
;
export
default
function
useCreate
(
fn
) {
var
hasBeenCalled =
React
.
useRef
(
false
);
if
(hasBeenCalled.
current
===
false
) {
fn
(); hasBeenCalled.
current
=
true
; } }