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)?.() || '';