amis-rpc-design/node_modules/rc-rate/es/useRefs.js

13 lines
300 B
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
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];
}