Closed akiradeveloper closed 5 years ago
Oh sorry, that was master branch's
the L112 (of v.0.5.1) is actually the line below (https://github.com/xcarpentier/react-native-country-picker-modal/blob/v0.5.1/src/CountryPicker.js)
static renderFlag(cca2, itemStyle, emojiStyle, imageStyle) {
return (
<View style={[styles.itemCountryFlag, itemStyle]}>
{isEmojiable
? CountryPicker.renderEmojiFlag(cca2, emojiStyle)
: CountryPicker.renderImageFlag(cca2, imageStyle)}
</View>
)
}
constructor(props) {
super(props)
this.openModal = this.openModal.bind(this)
let countryList = [...props.countryList] // L112
const excludeCountries = [...props.excludeCountries]
I found that props.countryList is undefined
I think the cause is defaultProps is somewhat ignored
@akiradeveloper you right. I got this error too on my Android. And I was found and solve problem :
<CountryPicker cca2={cca2.toUpperCase()} {...props} />
cca2 need to be in upper case. It help me
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This error arises once I changed from android:dev to android:prod. The RN version is 0.46.0 and library version is 0.5.1
My guess is that transpiler works badly; the calling of
from
method tells us that the pointed code isn't safe for the transpiler.