Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native React本机平面列表错误:对象作为React子对象无效_React Native_React Native Flatlist - Fatal编程技术网

React native React本机平面列表错误:对象作为React子对象无效

React native React本机平面列表错误:对象作为React子对象无效,react-native,react-native-flatlist,React Native,React Native Flatlist,一旦我添加了超过1条评论,我就会得到这个错误。我猜最新版本的react native存在一些语法问题,因为它无法读取注释数组。请帮忙 <FlatList refreshing={this.state.refresh} data={this.state.comments_list} keyExtractor={(item, index) => index.toString()}

一旦我添加了超过1条评论,我就会得到这个错误。我猜最新版本的react native存在一些语法问题,因为它无法读取注释数组。请帮忙

          <FlatList
            refreshing={this.state.refresh}
            data={this.state.comments_list}
            keyExtractor={(item, index) => index.toString()}
            style={{ flex: 1, backgroundColor: "#eee" }}
            renderItem={({ item, index }) => (
              <View key={index} style={styles.flatListViewItems}>
                <View style={{ padding: 5, width: "100%", flexDirection: "row", justifyContent: "space-between" }}>
                  <Text>time :{item.posted}</Text>
                  <TouchableOpacity
                    onPress={() =>
                      this.props.navigation.navigate("User", {
                        userId: item.authorId
                      })
                    }
                  >
                    <Text style={{ paddingRight: 5 }}>{item.author}</Text>
                  </TouchableOpacity>
                </View>
                <View style={{ padding: 5 }}>
                  <Text>{item.comment}</Text>
                </View>
              </View>
            )}
          />

文本组件无法渲染对象。就像错误显示的那样。 尝试更改此行:

<Text style={{ paddingRight: 5 }}>{item.author}</Text>
{item.author}

此错误表示正在渲染
文本中的对象。它应该是原始文本。尝试
控制台。警告(项目)
并查看正在渲染的对象。你有那些属性吗。
<Text style={{ paddingRight: 5 }}>{item.author}</Text>