I’m using @twotalltotems/react-native-otp-input library for otp input, but it is giving this error.
Here is my code :
import OTPInputView from '@twotalltotems/react-native-otp-input'
import React from "react";
import {StyleSheet,View,TouchableOpacity,Dimensions, KeyboardAvoidingView, Text} from "react-native";
const screenHeight = Dimensions.get('window').height
export default OtpScreenComponent = () => {
return (
<KeyboardAvoidingView>
<View style={styles.container}>
<OTPInputView
style={{width: '80%', height: 200}}
pinCount={6}
autoFocusOnLoad
codeInputFieldStyle={styles.underlineStyleBase}
codeInputHighlightStyle={styles.underlineStyleHighLighted}
onCodeFilled = {(code => {
console.log(`Code is ${code}, you are good to go!`)
})}
/>
<TouchableOpacity onPress={ () => {}}>
<Text>Submit Code</Text>
</TouchableOpacity>
</View>
</KeyboardAvoidingView>
);
}
I’m using the same code as given in the library readme section but not getting the issue.
This is the link of that library : https://www.npmjs.com/package/@twotalltotems/react-native-otp-input
Is there anything else that I should do to use this library like add something in build.gradle file etc.
Can someone please help me in this.
Thanks in advance.
2
Answers
I solved this issue by using "@react-native-community/clipboard" library along with "@twotalltotems/react-native-otp-input". So, both the libraries together solved my issue.
Can you explain what you mean when you say you used @react-native-community/clipboard along with react-native-otp-input? or share a code example