import { MutableRefObject } from 'react' ; import { useRef } from "react" ; function useLatest < T > ( value ) { const ref = useRef ( value ) ; ref . current = value ; return ref ; } export default useLatest ;