From cacc89483e5a3c9415e176ba2aa0cbf23c50388b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 5 Oct 2024 23:54:45 +0200 Subject: [PATCH] pl-fe: memoize purified instance description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../src/features/landing-timeline/components/site-banner.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pl-fe/src/features/landing-timeline/components/site-banner.tsx b/packages/pl-fe/src/features/landing-timeline/components/site-banner.tsx index 6cda8872e2..7e390b41f2 100644 --- a/packages/pl-fe/src/features/landing-timeline/components/site-banner.tsx +++ b/packages/pl-fe/src/features/landing-timeline/components/site-banner.tsx @@ -1,5 +1,5 @@ import DOMPurify from 'isomorphic-dompurify'; -import React from 'react'; +import React, { useMemo } from 'react'; import Markup from 'pl-fe/components/markup'; import { Stack } from 'pl-fe/components/ui'; @@ -10,7 +10,7 @@ import { LogoText } from './logo-text'; const SiteBanner: React.FC = () => { const instance = useInstance(); - const description = DOMPurify.sanitize(instance.description); + const description = useMemo(() => DOMPurify.sanitize(instance.description), [instance.description]); return (