react-native-confirmation-code-input
react-native-confirmation-code-input copied to clipboard
How can i create autofill when i recieve otp via sms.
@SukumarSmart First create a ref like below : this.otpCodeRef = React.CreateRef() <CodeInput ref={(value) => this.otpCodeRef = value} .... />
After reading the 4 digit OTP from the 3rd part module ( react-native-android-sms-listener ) const verificationCode = '<Filled by message>' const tmp = [...verificationCode] this.otpCodeRef.setState({ codeArr: tmp, currentIndex: 3 })
@gsmohan Thanks for the answer