Skip to content

Commit

Permalink
fix: replace useEffect() with useMount() when prefecthing images
Browse files Browse the repository at this point in the history
  • Loading branch information
yiukuenchu committed Oct 31, 2024
1 parent 63c1a4f commit 766695d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/HelpModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';

import { useHelpModal } from '../helpers/help-modal';
import { useMount } from '../utils/mount';
import { prefetchImages } from '../utils/prefetch-image';

export const HelpModal = () => {
Expand Down Expand Up @@ -74,10 +75,10 @@ export const HelpModal = () => {
},
];

useEffect(() => {
useMount(() => {
const imagePaths = STEPS.map((step) => step.image.path);
prefetchImages(imagePaths);
}, []);
});

const helpModal = useHelpModal();

Expand Down

0 comments on commit 766695d

Please sign in to comment.