Skip to content
Extraits de code Groupes Projets
Valider 1fc6cb49 rédigé par alpaca-tc's avatar alpaca-tc Validation de Eugen Rochko
Parcourir les fichiers

Do not call setState from unmounted component (#3853)

Stop an executing task if the component already unmounted.
parent eb832e88
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -86,6 +86,8 @@ class Status extends ImmutablePureComponent {
this.node,
this.handleIntersection
);
this.componentMounted = true;
}
componentWillUnmount () {
......@@ -96,6 +98,8 @@ class Status extends ImmutablePureComponent {
}
this.props.intersectionObserverWrapper.unobserve(this.props.id, this.node);
this.componentMounted = false;
}
handleIntersection = (entry) => {
......@@ -116,6 +120,10 @@ class Status extends ImmutablePureComponent {
}
hideIfNotIntersecting = () => {
if (!this.componentMounted) {
return;
}
// When the browser gets a chance, test if we're still not intersecting,
// and if so, set our isHidden to true to trigger an unrender. The point of
// this is to save DOM nodes and avoid using up too much memory.
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter