UNPKG

@td-design/react-native

Version:

react-native UI组件库

17 lines 480 B
export function addNewRef(refs, newRef) { refs.push({ current: newRef }); } export function removeOldRef(refs, oldRef) { refs = refs.filter(r => r.current !== oldRef); } export function getRef(refs) { const reversePriority = [...refs].reverse(); const activeRef = reversePriority.find(ref => (ref === null || ref === void 0 ? void 0 : ref.current) !== null); if (!activeRef) { return null; } return activeRef.current; } //# sourceMappingURL=ref-util.js.map