1import React from 'react';
2import { View, TextInput } from "react-native";
3
4class App extends React.Component {
5 constructor(props){
6 super(props);
7 this.state = {
8 name: ""
9 }
10 this.handleChange = this.handleChange.bind(this);
11 }
12 handleChange(text){
13 this.setState({ name: text })
14 console.log(this.props);
15 }
16 render() {
17 return (
18 <View>
19 <TextInput
20 value={this.state.name}
21 onChangeText={(text) =>this.handleChange(text)}
22 />
23 </View>
24 }
25}
26export default App;