Chris Collins ed2159bc36
feat(ui) Update Search & Browse to be a unified experience (#8235)
Co-authored-by: Josh Eilers <josh.eilers@acryl.io>
2023-06-21 13:40:07 +05:30

12 lines
229 B
TypeScript

import { useLayoutEffect, useRef } from 'react';
const useLatest = <T>(value: T) => {
const ref = useRef(value);
useLayoutEffect(() => {
ref.current = value;
});
return ref;
};
export default useLatest;