The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/hooks/usePreventProgation.ts

10 lines
342 B

import { useMutableCallback } from '@rocket.chat/fuselage-hooks';
import { MouseEvent } from 'react';
export const usePreventProgation = (fn: (e: MouseEvent) => void): ((e: MouseEvent) => void) => {
const preventClickPropagation = useMutableCallback((e): void => {
e.stopPropagation();
fn?.(e);
});
return preventClickPropagation;
};