ChatMessageList: fix pagination

This commit is contained in:
Alex Gleason
2022-06-17 17:33:25 -05:00
parent bf01c42397
commit a632bb99f9
3 changed files with 15 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
import { useRef } from 'react';
/** Hook that allows using useState values in event handlers. */
// https://stackoverflow.com/a/64770671/8811886
export const useRefEventHandler = (fn: (...params: any) => void) => {
const ref = useRef(fn);
ref.current = fn;
return ref;
};