ChatMessageList: fix pagination
This commit is contained in:
9
app/soapbox/hooks/useRefEventHandler.ts
Normal file
9
app/soapbox/hooks/useRefEventHandler.ts
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user