amis-rpc-design/node_modules/rc-rate/es/useRefs.js
2023-10-07 19:42:30 +08: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];
}