import { useEffect, useRef } from 'react';
export function useLifecycleLogger(componentName, deps) {
    const mountedRef = useRef(false);
    useEffect(() => {
        if (mountedRef.current) {
            console.log(`${componentName} updated`, deps && [...deps]);
        }
    }, deps);
    useEffect(() => {
        mountedRef.current = true;
        console.log(`${componentName} mounted`, deps && [...deps]);
        return () => {
            mountedRef.current = false;
            console.log(`${componentName} unmounted`);
        };
    }, []);
}
