import { useState } from "react"; import { Text, View } from "react-native"; import PhoneInput, { isValidPhoneNumber, } from "react-native-international-phone-number"; import "./../global.css"; import { Button } from "./components/ui/button"; export default function App() { const [selectedCountry, setSelectedCountry] = useState(null); const [inputValue, setInputValue] = useState(""); function handleInputValue(phoneNumber: any) { setInputValue(phoneNumber); } function handleSelectedCountry(country: any) { setSelectedCountry(country); } return ( Country:{" "} {`${selectedCountry?.name?.en} (${selectedCountry?.cca2})`} Phone Number: {`${selectedCountry?.callingCode} ${inputValue}`} isValid:{" "} {isValidPhoneNumber(inputValue, selectedCountry) ? "true" : "false"} ); }