We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14c9664 commit 7e421e7Copy full SHA for 7e421e7
src/components/widgets/edit/FactsItems.tsx
@@ -1,3 +1,4 @@
1
+import { useMemo } from 'react';
2
import { useTranslation } from 'react-i18next';
3
import { TFactsWidgetOptions } from '../../../store/types/widgets';
4
import { BodySSB, Title } from '../../../styles/text';
@@ -6,7 +7,7 @@ import { EWidgetItemType, TWidgetItem } from './types';
6
7
8
export const getFactsItems = (options: TFactsWidgetOptions): TWidgetItem[] => {
9
const { t } = useTranslation('widgets');
- const fact = getRandomFact();
10
+ const fact = useMemo(() => getRandomFact(), []);
11
12
return [
13
{
0 commit comments