diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index b19de0feb..a472c3f50 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { ForwardedRef } from 'react'; import { InteractionManager, Text, View } from 'react-native'; import { connect } from 'react-redux'; import parse from 'url-parse'; @@ -185,8 +185,8 @@ class RoomView extends React.Component { private retryInitTimeout?: ReturnType; private retryFindCount?: number; private retryFindTimeout?: ReturnType; - private messageErrorActions: any; - private messageActions: any; + private messageErrorActions?: React.ForwardedRef; + private messageActions?: React.ForwardedRef; constructor(props: IRoomViewProps) { super(props); @@ -648,6 +648,7 @@ class RoomView extends React.Component { }; errorActionsShow = (message: string) => { + // @ts-ignore this.messageErrorActions?.showMessageErrorActions(message); }; @@ -696,6 +697,7 @@ class RoomView extends React.Component { }; onMessageLongPress = (message: string) => { + // @ts-ignore this.messageActions?.showMessageActions(message); }; @@ -1214,7 +1216,7 @@ class RoomView extends React.Component { return ( <> (this.messageActions = ref)} + ref={(ref: ForwardedRef) => (this.messageActions = ref)} tmid={this.tmid} room={room} user={user} @@ -1224,7 +1226,10 @@ class RoomView extends React.Component { onReactionPress={this.onReactionPress} isReadOnly={readOnly} /> - (this.messageErrorActions = ref)} tmid={this.tmid} /> + ) => (this.messageErrorActions = ref)} + tmid={this.tmid} + /> ); };