Skip to content

Commit

Permalink
fixed memory leak in useeffect
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausMikhaelson committed Jan 17, 2024
1 parent 4d18e64 commit fb696cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sections/yield/YieldStatsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ const YieldStatsSection = ({
};

React.useEffect(() => {
setTimeout(() => {
const timeout = setTimeout(() => {
getFormattedDuration();
}, 1000);

return () => clearTimeout(timeout);
});


Expand Down

0 comments on commit fb696cd

Please sign in to comment.