From f68d87d7161d87f1b8490d83a830a8756f94e67b Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 24 Jun 2024 19:07:28 -0500 Subject: [PATCH] Memo instead of state --- src/components/FeedCard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx index 4a0261a156..ecf0a1b91a 100644 --- a/src/components/FeedCard.tsx +++ b/src/components/FeedCard.tsx @@ -199,12 +199,12 @@ export function TitleAndBylinePlaceholder({creator}: {creator?: boolean}) { } export function Description({description}: {description?: string}) { - const [rt] = React.useState(() => { + const rt = React.useMemo(() => { if (!description) return const rt = new RichTextApi({text: description || ''}) rt.detectFacetsWithoutResolution() return rt - }) + }, [description]) if (!rt) return null return }