import { useEffect, useState } from "react";
const useElementList = (ref, selectors, options) => {
	const [elementList, setElementList] = useState();
	useEffect(() => {
		const handleMutationChange = () => {
			const elements = ref.current?.querySelectorAll(selectors);
			setElementList(elements);
		};
		const mutationObserver = new MutationObserver(handleMutationChange);
		if (ref?.current) mutationObserver.observe(ref.current, {
			subtree: true,
			childList: true,
			attributes: true,
			...options
		});
		handleMutationChange();
		return () => {
			mutationObserver.disconnect();
		};
	}, [ref, selectors]);
	return elementList;
};
export { useElementList as t };

//# sourceMappingURL=useElementList.js.map