Open dprajapati1179 opened 1 year ago
@dprajapati1179 You're right for a quick fix, you can use the debounce function from lodash
import debounce from 'lodash/debounce';
import OTPInputView from '@twotalltotems/react-native-otp-input';
export default function App() {
const onCodeFilled = debounce((code) => {
sendCode(code, navigation);
}, 500)
return (
<OTPInputView
pinCount={4}
onCodeFilled={onCodeFilled}
/>
);
}
sendCode(code, navigation);
You are right @baraa-rasheed But when we are calling API at that time it is calling the API after debounced time and due to that duplicate data is created sometimes
Describe the bug The onCodeFilled Callback function which triggers when all fields of the OTP have been filled is called 2-4 times due to which the functionality is braking in my app.
To Reproduce Steps to reproduce the behavior:
Expected behavior It should work only one time once the code is filled as working on Android.
Smartphone (please complete the following information):