bindIp
我是新来的本地人。我在hello {this.state.value}行上遇到错误。我该如何解决。请帮助我
答案 0 :(得分:2)
你可以试试吗?
export default class App extends Component<Props> {
constructor(Props) {
super(props);
this.state = {
value: "Edit me!"
};
}
handleChangeText = (newText) => {
this.setState({
value: newText
});
}
render() {
return (
<View style={styles.container}>
<TextInput
style={styles.editText}
onChangeText={this.handleChangeText}
/>
<Text>hello {this.state.value}</Text>
</View>
);
}
}