react-native点击子组件触发父组件的方法
class类组件
父
<THButton clickPress={()=>alert(1)} style={{borderRadius: 20}}>获取验证码</THButton>
btnSubimt=()=>{
alert(11)
}
子
<TouchableOpacity onPress={this.props.clickPress} activeOpacity={.8} style={{width: "100%",overflow:'hidden', ...this.props.style}}><Text>确定</Text></TouchableOpacity>
函数式组件
父
子