Wizard: Add eslint-disable to useEffect

This disables `react-hooks/exhaustive-deps` rule for dependency arrays that should run only once on mount and therefore need to stay empty.
This commit is contained in:
regexowl 2024-08-12 10:21:44 +02:00 committed by Michal Gold
parent 03e0061fc6
commit a3abc29f51
2 changed files with 6 additions and 0 deletions

View file

@ -40,6 +40,9 @@ const DetailsStep = () => {
)
);
}
// This useEffect hook should run *only* on mount and therefore has an empty
// dependency array. eslint's exhaustive-deps rule does not support this use.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const handleNameChange = (
_event: React.FormEvent<HTMLInputElement>,

View file

@ -18,6 +18,9 @@ const OscapStep = () => {
const release = useAppSelector(selectDistribution);
useEffect(() => {
prefetchOscapProfile({ distribution: release });
// This useEffect hook should run *only* on mount and therefore has an empty
// dependency array. eslint's exhaustive-deps rule does not support this use.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (