-1
import React, { Component } from 'react';
import { AppRegistry, Text, View, TouchableOpacity } from 'react-native';
class Check extends Component {
constructor(props){
super(props);
this.pressed = true
}
_callme =() => {
if(!this.pressed){
return (<View>
<TouchableOpacity onPress={this._callMe}>
Show me TextBox
</TouchableOpacity>
</View>
)
}
else{
return (
<View>
<TextInput />
</View>)
}
}
showText =() => {
return (
<TouchableOpacity on Press={this._callMe}>
<Text>Show me TextBox</Text>
</TouchableOpacity>
)
}
render() {
return(
<View>
{this.pressed ? this._callMe : this.showText}
</View>
)
}
}
AppRegistry.registerComponent('Check',() => Check);
ReactNativeの初心者です。ユーザーがボタンをクリックしたときにユーザーがコメント用のポップアップボックスを表示する必要がありますが、どこが間違っているのかわかりません。テキストボックスonPressを表示している状態で反応しますか?