How do you get elements in react-native?
My use-case is a login screen. the submit button is pressed and now i want to get the value of username and password TextInputs.
      export default class Login extends Component 
      {
        login()
        {
          //document.getElementById('username'); //run-time error
        }
        render() 
        {
          return (
            <View style={{flex: 1,flexDirection: 'column',justifyContent: 'space-between',margin:10}}>
              <View style={{backgroundColor: 'powderblue'}} />
              <MyTextField id='user' placeholder="User Name" />
              <MyTextField id='pass' placeholder="Password" />
              <MyButton onPress={this.login} title='Login'/>
            </View>
          );
        }
      }
				
                        
You don't have get getElementById in react native, you have to use state. you can do like this: