ではありません。(ネイティブと反応)のNullはこのコードの一部は、ネイティブのトラブルレンダリングをしているリアクトあるオブジェクト
You input {this.state.zip}.
イム初心者が、私は「学習ネイティブに反応」のチュートリアル次まだ彼ました本のコードが機能していません。
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
TextInput,
Image,
View
} from 'react-native';
class WeatherProject extends Component {
// If you want to have a default zip code, you could add one here
getInitialState() {
return ({
zip: ''
});
}
// We'll pass this callback to the <TextInput>
_handleTextChange(event) {
// log statements are viewable in Xcode,
// or the Chrome debug tools
console.log(event.nativeEvent.text);
this.setState({
zip: event.nativeEvent.text
});
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
You input {this.state.zip}.
</Text>
<TextInput
style={styles.input}
onSubmitEditing={this._handleTextChange}/>
</View>
);
}
}
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
borderWidth: 2,
height: 40
}
});
AppRegistry.registerComponent('WeatherProject',() => WeatherProject);
[enter image description here][1]
は「苦労」と「動作しない」とはどういう意味-だろうか?エラーメッセージが表示されますか?メッセージを投稿してください。それに行番号が含まれている場合は、あなたの投稿にある行を教えてください。 –