From e436e28f01dcbc4bdc7290d99f0394b7a64e5eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 24 Jun 2021 14:31:04 +0200 Subject: [PATCH] Make TS happy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/TextForEvent.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 4c2c264439..10c787bcb6 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -669,7 +669,8 @@ export function hasText(ev): boolean { return Boolean(handler?.(ev)); } -export function textForEvent(ev: MatrixEvent): string +export function textForEvent(ev: MatrixEvent): string; +export function textForEvent(ev: MatrixEvent, allowJSX: true): string | JSX.Element; export function textForEvent(ev: MatrixEvent, allowJSX = false): string | JSX.Element { const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()]; return handler?.(ev, allowJSX)?.() || '';