JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "use-previous.ts"

Full Path: /home/markqprx/iniasli.pro/resources/client/utils/hooks/use-previous.ts
File size: 330 bytes
MIME-type: text/plain
Charset: utf-8

import {useEffect, useRef} from 'react';

export function usePrevious<T>(value: T) {
  const ref = useRef<T>();
  // Store current value in ref
  useEffect(() => {
    ref.current = value;
  }, [value]); // Only re-run if value changes
  // Return previous value (happens before update in useEffect above)
  return ref.current;
}