react-native-confirmation-code-input icon indicating copy to clipboard operation
react-native-confirmation-code-input copied to clipboard

issue: code.split is not a function. (In 'code.split("")','code.split' is undefined)

Open KrushnaNaghate opened this issue 3 years ago • 1 comments

<OTPInputView style={{ width: '100%', height: 50, alignSelf: 'center', marginBottom: 20, }} pinCount={6} code={(this.state.code)} //You can supply this prop or not. The component will be used as a controlled / uncontrolled component respectively. onCodeChanged = {code =>{ if (code.length === 6) { { this.setState({code},()=>{ console.log('codeotp',this.state.code); })}}}} autoFocusOnLoad={false} keyboardType="number-pad" codeInputFieldStyle={{ width: 32, height: 45, borderWidth: 2, alignSelf: 'center', borderRadius: 5, color: color.secondarycolor, }} codeInputHighlightStyle={{ borderColor: color.secondarycolor,

            }}
            onCodeFilled={code => {

Screenshot_2022-08-02-19-32-18-81_c11b992e6582eb7cde7f603a58deef46

              console.log(`Code is ${code}, you are good to go!`);
            }}
            // placeholderTextColor={{color:color.primarycolor}}
          />``

I'm getting this, issue when I want to pass default value to otp , I need to add default value for getting autofill otp by hash code sms

KrushnaNaghate avatar Aug 02 '22 14:08 KrushnaNaghate

@KrushnaNaghate

You can use a fork without this problem and with better maintainability

https://github.com/retyui/react-native-confirmation-code-field

retyui avatar Aug 02 '22 14:08 retyui