Skip to content

Commit

Permalink
fix: memory leak with updateVariantTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
hudovisk committed Mar 29, 2020
1 parent 25f6c15 commit 4272125
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Experiment extends React.Component {
}

componentWillUnmount() {
clearTimeout(this.updateVariantTimeout);
typeof window !== "undefined" &&
window.gtag &&
window.gtag("event", "optimize.callback", {
Expand Down

0 comments on commit 4272125

Please sign in to comment.