PromoCursed/node_modules/rc-rate/es/useRefs.js
2024-08-20 23:25:37 +04:00

13 lines
300 B
JavaScript

import * as React from 'react';
export default function useRefs() {
var nodeRef = React.useRef({});
function getRef(index) {
return nodeRef.current[index];
}
function setRef(index) {
return function (node) {
nodeRef.current[index] = node;
};
}
return [getRef, setRef];
}