로 가져 오기 내에서 검색 한 값을 표시 할 수 없습니다
는 '널 (null)이 객체가 아닌'가져 오기 내에서 가지고 :
import React, {Component} from 'react';
import { StyleSheet, Image, Text, View, TextInput, StatusBar, Button,
AppRegistry, TouchableHighlight, TouchableOpacity } from 'react-native';
import AndroidBackButton from 'react-native-android-back-button'
import { StackNavigator } from 'react-navigation'
export default class ComponenFive extends React.Component {
getInfos(){
fetch('http://172.16.101.183:3000/users', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
requestType: 'infosCompte'
})
})
.then((response) => response.json())
.then((res) => {
this.setState({username: res.username, nom: res.nom, prenom: res.prenom, lieu: res.lieu, batiment: res.batiment, bureau: res.bureau});
})
.done();
}
render() {
{this.getInfos}
return (
<View style={{backgroundColor: 'white', flex: 1}}>
<Text>Identifiant : {this.state.username}</Text>
</View>
)
}
}
당신이 날 수 있도록 어떤 생각을 가지고 있습니까?
귀하의 답변을 주셔서 감사합니다,하지만, 난 여전히 아 난 몰랐어 –
같은 오류 메시지가! 고마워요. 지금 일하고 있어요! –
내 업데이트 된 대답을 확인 –