<查看>{这个。\u getCategories(item)}</查看>
\u getCategories方法在使用item参数检索正确的数据之后返回一个文本元素。简化版本如下所示:
_getCategories = item => {
names = 'some string';
console.log(names); //this logs the correct string
return <Text style={styles.categories}>{names}</Text>;
};
Text元素不会出现在应用程序中,如果在View元素中使用{String(names)},则显示undefined。