diff --git a/src/NodeAnimator.tsx b/src/NodeAnimator.tsx index ec0602b3b5..85151bf3b0 100644 --- a/src/NodeAnimator.tsx +++ b/src/NodeAnimator.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, { Key, ReactElement, ReactFragment, ReactInstance, ReactPortal } from "react"; +import React, { Key, MutableRefObject, ReactElement, ReactFragment, ReactInstance, ReactPortal } from "react"; import ReactDom from "react-dom"; interface IChildProps { @@ -31,6 +31,8 @@ interface IProps { // a list of state objects to apply to each child node in turn startStyles: React.CSSProperties[]; + + innerRef?: MutableRefObject; } function isReactElement(c: ReactElement | ReactFragment | ReactPortal): c is ReactElement { @@ -123,6 +125,10 @@ export default class NodeAnimator extends React.Component { }, 0); } this.nodes[k] = node; + + if (this.props.innerRef) { + this.props.innerRef.current = node; + } } public render(): React.ReactNode { diff --git a/src/components/views/rooms/ReadReceiptMarker.tsx b/src/components/views/rooms/ReadReceiptMarker.tsx index 06fe783ce6..7b907e6f23 100644 --- a/src/components/views/rooms/ReadReceiptMarker.tsx +++ b/src/components/views/rooms/ReadReceiptMarker.tsx @@ -208,7 +208,7 @@ export default class ReadReceiptMarker extends React.PureComponent +