import { useState, useMemo, useCallback } from "react";
import autoAnimate from "../index.js";
function useAutoAnimate(options) {
  const [controller, setController] = useState();
  const memoizedOptions = useMemo(() => options, []);
  const element = useCallback((node) => {
    if (node instanceof HTMLElement) {
      setController(autoAnimate(node, memoizedOptions));
    } else {
      setController(void 0);
    }
  }, [memoizedOptions]);
  const setEnabled = useCallback((enabled) => {
    if (controller) {
      enabled ? controller.enable() : controller.disable();
    }
  }, [controller]);
  return [element, setEnabled];
}
export {
  useAutoAnimate
};
//# sourceMappingURL=index.js.map
