Open PTBYSR opened 1 year ago
import React, { useState } from "react"; import { View, StyleSheet, TouchableOpacity, TextInput } from "react-native"; import { Feather } from "@expo/vector-icons"; // import PhoneInput from "react-native-phone-input"; const PhoneNumberInput = ({ placeholder, onChange, value }) => { const [secureTextEntry, setSecureTextEntry] = useState(true); const [phoneNumber, setPhoneNumber] = useState(false); const phoneRef = useRef(undefined); return ( <View style={{ backgroundColor: "#3a6083", width: "85%", height: 50, marginTop: 10, flexDirection: "row", borderRadius: 30, }} > <PhoneInput style={styles.phoneInput} ref={phoneRef} value={phoneNumber} onChangePhoneNumber={setPhoneNumber} textProps={{ placeholder: 'Enter a phone number...', }} textStyle={{ color: "#fff", }} /> <TouchableOpacity activeOpacity={0.8} onPress={() => setSecureTextEntry(!secureTextEntry)} style={{ width: "12%", height: "100%", alignItems: "flex-start", justifyContent: "center", }} > {secureTextEntry ? ( <Feather name="eye-off" size={16} color="#ddd" /> ) : ( <Feather name="eye" size={16} color="#ddd" /> )} </TouchableOpacity> </View> ); }; const styles = StyleSheet.create({}); export default PhoneNumberInput;
BUG- Just by importing react-native-phone-input I'm getting the error Invariant Violation: Tried to register two views with the same name RNCAndroidDialogPicker
react-native-phone-input
Invariant Violation: Tried to register two views with the same name RNCAndroidDialogPicker
I'm experiencing this same issue after upgrading to Expo SDK 48, any luck!?
BUG- Just by importing
react-native-phone-input
I'm getting the errorInvariant Violation: Tried to register two views with the same name RNCAndroidDialogPicker