React nativeで Form の 値を取得してconsole.logする方法
ステートとかで状態維持しないバージョン。まずはフォームはこんな感じ。
<Form> <TextInput style={{height: 40}} placeholder="userName" onChangeText={(text) => this.userName = text} /> <TextInput style={{height: 40}} placeholder="Password" onChangeText={(text) => this.Password = text} /> <Button title="Sign in!" onPress={this._signInAsync} /> </Form>
参考
https://stackoverflow.com/questions/32913338/react-native-get-textinput-value/53878044#53878044