pl-fe: memoize purified instance description

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-10-05 23:54:45 +02:00
parent 3e94d9dd53
commit cacc89483e

View file

@ -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 (
<Stack space={6}>