Skip to content

Commit 93eb64c

Browse files
committed
fix: add optional chaining to stopPropagation and preventDefault functions
1 parent 62c0daa commit 93eb64c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Common/Helper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ export function sortCallback(key: string, a: any, b: any, isCaseSensitive?: bool
123123
}
124124

125125
export const stopPropagation = (event): void => {
126-
event.stopPropagation()
126+
event?.stopPropagation()
127127
}
128128

129129
export const preventDefault = (event: SyntheticEvent): void => {
130-
event.preventDefault()
130+
event?.preventDefault()
131131
}
132132

133133
export function useThrottledEffect(callback, delay, deps = []) {

0 commit comments

Comments
 (0)