import { useRef,useEffect } from 'react'; const usePrevious = (typeFile: string): string | undefined => { const ref = useRef<string | undefined>(); useEffect(() => { ref.current = typeFile; }); return ref.current; }; export { usePrevious }