Skip to content

I want to define a default country and cancel country selection #4

Closed Answered by AstrOOnauta
ysnbyzli asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ysnbyzli !

About your question, nice point!
The version 0.4.10 or earlier does not support this feature, but I released a next version with new feat to disable the country modal.
Please update the lib version to v0.4.11 and use the following code to resolve your issue:

import { PhoneInput, getCountryByCca2 } from 'react-native-international-phone-number';
...
 const [selectedCountry, setSelectedCountry] = useState(getCountryByCca2("BR");
...
 <PhoneInput
    ...
    modalDisabled   <--- Add This Props
  />

OBS.: Referenced in this new point in the docs:
https://github.com/AstrOOnauta/react-native-international-phone-number#country-modal-disabled-mode

🚀AstrOOnauta 🚀

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ysnbyzli
Comment options

Answer selected by AstrOOnauta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants