We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b813173 commit b9e850cCopy full SHA for b9e850c
ActionButton.js
@@ -30,7 +30,12 @@ export default class ActionButton extends Component {
30
this.timeout = null;
31
}
32
33
+ componentDidMount() {
34
+ this.mounted = true;
35
+ }
36
+
37
componentWillUnmount() {
38
+ this.mounted = false;
39
clearTimeout(this.timeout);
40
41
@@ -326,10 +331,11 @@ export default class ActionButton extends Component {
326
331
this.anim.setValue(0);
327
332
328
333
329
- setTimeout(
330
- () => this.setState({ active: false, resetToken: this.state.resetToken }),
- 250
- );
334
+ setTimeout(() => {
335
+ if (this.mounted) {
336
+ this.setState({ active: false, resetToken: this.state.resetToken });
337
338
+ }, 250);
339
340
341
0 commit comments