From 0dde6f008f20d9eb0eef0aa565b99ae1d5454b77 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 21 Dec 2023 10:18:15 -0600 Subject: [PATCH] StatusContent: fix types for html-react-parser v5 --- src/components/status-content.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/status-content.tsx b/src/components/status-content.tsx index 00b960815..c69459106 100644 --- a/src/components/status-content.tsx +++ b/src/components/status-content.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import parse, { Element, type HTMLReactParserOptions, domToReact } from 'html-react-parser'; +import parse, { Element, type HTMLReactParserOptions, domToReact, type DOMNode } from 'html-react-parser'; import React, { useState, useRef, useLayoutEffect, useMemo } from 'react'; import { FormattedMessage } from 'react-intl'; @@ -105,7 +105,7 @@ const StatusContent: React.FC = ({ } if (classes?.includes('hashtag')) { - const child = domToReact(domNode.children); + const child = domToReact(domNode.children as DOMNode[]); const hashtag = typeof child === 'string' ? child.replace(/^#/, '') : undefined; if (hashtag) { return ; @@ -121,7 +121,7 @@ const StatusContent: React.FC = ({ target='_blank' title={domNode.attribs.href} > - {domToReact(domNode.children, options)} + {domToReact(domNode.children as DOMNode[], options)} ); }