RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/lib/utils/preventSyntheticEvent.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { SyntheticEvent } from 'react';

export const preventSyntheticEvent = (e: SyntheticEvent): void => {
    if (e) {
        (e.nativeEvent || e).stopImmediatePropagation();
        e.stopPropagation();
        e.preventDefault();
    }
};