Skip to content

Commit

Permalink
warn about useEffect cleanup hms-dbmi#652
Browse files Browse the repository at this point in the history
xinaesthete committed Nov 18, 2022
1 parent 8767bb8 commit ee7bb2b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sites/avivator/src/hooks.js
Original file line number Diff line number Diff line change
@@ -80,6 +80,9 @@ export const useImage = (source, history) => {
}
}
if (source) changeLoader();
return () => {
console.warn('useEffect in useImage should cleanup.');
};
}, [source, history]); // eslint-disable-line react-hooks/exhaustive-deps
useEffect(() => {
const changeSettings = async () => {
@@ -164,6 +167,9 @@ export const useImage = (source, history) => {
});
};
if (metadata) changeSettings();
return () => {
console.warn('second useEffect in useImage should cleanup...');
};
}, [loader, metadata]); // eslint-disable-line react-hooks/exhaustive-deps
};

0 comments on commit ee7bb2b

Please sign in to comment.