我从Github api中使用React Native中的fetch命令提取一些信息。反应本机 - 对象作为反应孩子无效
我有一个应该显示JSON信息的仪表盘:
class Dashboard extends React.Component{
render(){
return(
<View style={styles.container}>
<Text> This is the dashboard </Text>
<Text> {this.props.userInfo} </Text>
</View>
)
}
};
它的抱怨,并给我这个错误:
ExceptionsManager.js:61级的对象是不是一个做出反应的孩子有效(找到:带有键的对象{login,id,avatar_url,gravatar_id,url,html_url,followers_url,following_url,gists_url,starred_url,subscriptions_url,organizational_url,repos_url,events_url,received_events_url,类型,site_admin,名称,公司,博客,位置,可出租,生物,public_repos,public_gists,followers,following,created_at,updated_at})。如果您打算渲染一组儿童,请改用数组,或者使用React附加组件中的createFragment(object)来包装对象。检查Text
的渲染方法。
在上下文中,这似乎与egghead.io React Native课程相关,具体是第6课:https://egghead.io/lessons/react-06-react-native-passing-data-when-changing-routes – nikolasleblanc