diff --git a/README.md b/README.md index b50c73b1..34ba4eb1 100644 --- a/README.md +++ b/README.md @@ -44,29 +44,33 @@ componentDidMount(){ }) } -onPressFlag(){ - this.myCountryPicker.open() -} +onPressFlag = () => { + this.setState({visible: true}); +}; -selectCountry(country){ - this.phone.selectCountry(country.iso2) -} +selectCountry = (country) => { + this.setState({ + cca2: country.cca2.toLowerCase(), + phone: `+${country.callingCode[0]}`, + }); +}; render(){ return( - { this.phone = ref; }} - onPressFlag={this.onPressFlag} - /> - - { this.myCountryPicker = ref; }} - data={this.state.pickerData} - onChange={(country)=>{ this.selectCountry(country) }} - cancelText='Cancel' - /> - + this.setState({phone: tell})} + value={phone} + /> + this.selectCountry(value)} + translation="eng" + cca2={this.state.cca2}> + + + ) } ``` @@ -117,7 +121,7 @@ render(){ ## Custom Countries ```jsx - + ``` ## Configuration