Skip to content

Commit c4ed5fb

Browse files
committed
fix: revert unmount exception
1 parent 50cbcd3 commit c4ed5fb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,15 @@ class HCaptcha extends React.Component {
8383
const hcaptcha = this._hcaptcha;
8484
const captchaId = this.captchaId;
8585

86+
this._cancelPendingExecute('react-component-unmounted');
87+
8688
if (!this.isReady()) {
87-
this._cancelPendingExecute('react-component-unmounted');
8889
return;
8990
}
9091

9192
// Reset any stored variables / timers when unmounting
9293
hcaptcha.reset(captchaId);
9394
hcaptcha.remove(captchaId);
94-
95-
this._cancelPendingExecute('react-component-unmounted');
9695
}
9796

9897
shouldComponentUpdate(nextProps, nextState) {

0 commit comments

Comments
 (0)