【发布时间】:2021-03-15 05:01:52
【问题描述】:
我集成了一个名为 rn-country-picker 的依赖项,并在我的 react native 应用程序中使用。它之前工作正常,但现在它抛出错误“TypeError:未定义不是对象(evlauating 'newData[0].flag')。”我无法弄清楚错误的确切原因。
我使用该库的部分有以下代码:
{/* COuntry */}
<View style={styles.container}>
<Text style={styles.titleText}>Select your country</Text>
<CountryPicker
disable={false}
animationType={"fade"}
containerStyle={styles.pickerStyle}
pickerTitleStyle={styles.pickerTitleStyle}
selectedCountryTextStyle={styles.selectedCountryTextStyle}
countryNameTextStyle={styles.countryNameTextStyle}
pickerTitle={"Select your country"}
searchBarPlaceHolder={"Search......"}
hideCountryFlag={false}
hideCountryCode={false}
searchBarStyle={styles.searchBarStyle}
countryCode={this.state.mCountryCode}
selectedValue={this._selectedValue}
/>
</View>
这是 Vishal Dhanotiya 的一个依赖项,您可以从以下网址找到代码:https://github.com/vishaldhanotiya/rn-country-picker/blob/master/index.js
它在第 84 行显示错误。我只从组件中删除了道具,除此之外我没有触及任何其他代码。以前很好,但是突然抛出这个错误。请帮忙。
【问题讨论】:
标签: javascript react-native typeerror