UNPKG
ariakit-react-utils
Version:
latest (0.17.0-next.27)
0.17.0-next.27
0.17.0-next.26
Ariakit React utils
ariakit.org
ariakit/ariakit
ariakit-react-utils
/
esm
/
misc.js
13 lines
(11 loc)
•
206 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
/** * Sets both a function and object React ref. */
function
setRef
(
ref
,
value
)
{
if
(
typeof
ref
===
"function"
) {
ref
(
value
); }
else
if
(
ref
) {
ref
.current =
value
; } } export { setRef };