index.tsx 263 B

12345678910111213
  1. import { useRef,useEffect } from 'react';
  2. const usePrevious = (typeFile: string): string | undefined => {
  3. const ref = useRef<string | undefined>();
  4. useEffect(() => {
  5. ref.current = typeFile;
  6. });
  7. return ref.current;
  8. };
  9. export {
  10. usePrevious
  11. }