UNPKG
@wfp/react
Version:
alpha (1.21.55)
latest (1.22.0)
1.22.0
1.21.55
1.21.54
1.21.53
1.21.52
1.21.51
1.21.50
1.21.49
1.21.48
1.21.47
1.21.46
1.21.45
1.21.44
1.21.43
1.21.42
1.21.41
1.21.40
1.21.39
1.21.38
1.21.37
1.21.36
1.21.35
1.21.34
1.21.33
1.21.32
1.21.31
1.21.30
1.21.29
1.21.28
1.21.27
1.21.26
1.21.25
1.21.24
1.21.23
1.21.22
1.21.21
1.21.20
1.21.19
1.21.18
1.21.17
1.21.16
1.21.15
1.21.14
1.21.13
1.21.12
1.21.11
1.21.10
1.21.9
1.21.8
1.21.7
1.21.6
1.21.5
1.21.4
1.21.3
1.21.2
1.19.9
1.19.8
1.19.1
1.19.0
1.18.109
1.18.108
1.18.107
1.18.106
1.18.105
1.18.104
1.18.103
1.18.102
1.18.101
1.18.100
1.18.99
1.18.98
1.18.97
1.18.82
WFP UI Kit
github.com/wfp/ui
wfp/ui
@wfp/react
/
src
/
tools
/
setupGetInstanceId.js
11 lines
(10 loc)
•
245 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
/** * Generic utility to initialize a method that will return a unique instance id * for a component. */
export
default
function
setupGetInstanceId
()
{
let
instanceId =
0
;
return
function
getInstanceId
()
{
return
++instanceId; }; }