"use strict";

exports.__esModule = true;
exports.default = useRefs;

var _react = _interopRequireDefault(require("react"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
function useRefs() {
  var refs = _react.default.useRef([]);

  var setRefs = _react.default.useCallback(function (index) {
    return function (el) {
      if (el) refs.current[index] = el;
    };
  }, []);

  var reset = _react.default.useCallback(function () {
    refs.current = [];
  }, []);

  return [refs.current, setRefs, reset];
}