tttstudios / react-native-otp-input

Tiny Javascript library which provides an elegant UI for user to input one time passcode.
MIT License
528 stars 239 forks source link

Excessive number of pending callbacks: 501 #156

Open ajitdas123 opened 2 years ago

ajitdas123 commented 2 years ago

Describe the bug All of a sudden after using for a while, it started to give me this error

ExceptionsManager.js:179 Warning: Please report: Excessive number of pending callbacks: 501. Some pending callbacks that might have leaked by never being called from native code: {"4426":{},"4427":{},"4428":{},"4429":{},"4430":{},"4431":{},"4432":{},"4433":{},"4434":{},"4435":{},"4436":{},"4437":{},"4438":{},"4439":{},"4440":{},"4441":{},"4442":{},"4443":{},"4444":{},"4445":{},"4446":{},"4447":{},"4448":{},"4449":{},"4450":{},"4451":{},"4452":{},"4453":{},"4454":{},"4455":{},"4456":{},"4457":{},"4458":{},"4459":{},"4460":{},"4461":{},"4462":{},"4463":{},"4464":{},"4465":{},"4466":{"module":"RNCClipboard","method":"getString"},"4467":{"module":"RNCClipboard","method":"getString"},"4468":{"module":"RNCClipboard","method":"getString"},"4469":{"module":"RNCClipboard","method":"getString"},"4470":{},"4471":{},"4472":{},"4473":{},"4474":{},"4475":{},"...(truncated keys)...":451}

To Reproduce Not sure the exact steps to reproducee, but this is the code i am using

  <OTPInputView
          style={Styles.Container}
          pinCount={5}
          code={this.props.value?this.props.value:''}
          onCodeChanged={this.props.onCodeChanged}
          autoFocusOnLoad
          codeInputFieldStyle={Styles.underlineStyleBase}
          codeInputHighlightStyle={Styles.underlineStyleHighLighted}
        />

// This is oncode change function on inside another class component
onCodeChanged =(value) => {
console.log(value); // it seems the response is taking too long to log, like 1-2sec or so after u fill the input on the boxes, which was not the case before
this.setState({
      otp: value,
    });
}

And after filling 4 number on the otp input, it throw that error.

Expected behavior It should instantly log the number without throwing any kind of error

I have checked some similar issues, https://github.com/facebook/react-native/issues/31988 . But i dont think there is any kind of looping here in this code i believe.

Smartphone (please complete the following information):

Solid-Metal commented 11 months ago

up, got this as well