Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

Fix stopEventPropagation typing (#5802)

authored by yoginth.com and committed by

GitHub 4b5fe22d 72705ea3

+10 -2
+5 -1
apps/web/src/helpers/stopEventPropagation.test.ts
··· 1 + import type { MouseEvent } from "react"; 1 2 import { describe, expect, it, vi } from "vitest"; 2 3 import stopEventPropagation from "./stopEventPropagation"; 3 4 4 5 describe("stopEventPropagation", () => { 5 6 it("calls stopPropagation", () => { 6 - const event = { stopPropagation: vi.fn() } as any; 7 + const event = { 8 + stopPropagation: vi.fn() 9 + } as unknown as MouseEvent<HTMLElement>; 10 + 7 11 stopEventPropagation(event); 8 12 expect(event.stopPropagation).toHaveBeenCalled(); 9 13 });
+5 -1
apps/web/src/helpers/stopEventPropagation.ts
··· 1 - const stopEventPropagation = (event: any) => event.stopPropagation(); 1 + import type { MouseEvent } from "react"; 2 + 3 + const stopEventPropagation = (event: MouseEvent<Element>) => { 4 + event.stopPropagation(); 5 + }; 2 6 3 7 export default stopEventPropagation;