rili-live / react-native-phone-input

Phone input box for React Native
https://www.npmjs.com/package/react-native-phone-input
MIT License
42 stars 54 forks source link

Invariant Violation: Tried to register two views with the same name RNCAndroidDialogPicker, when only importing react-native-phone-input #49

Open PTBYSR opened 1 year ago

PTBYSR commented 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

andelh commented 1 year ago

I'm experiencing this same issue after upgrading to Expo SDK 48, any luck!?