pl-fe: memoize purified instance description
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
3e94d9dd53
commit
cacc89483e
1 changed files with 2 additions and 2 deletions
|
@ -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}>
|
||||
|
|
Loading…
Reference in a new issue