父
this.state={name:''}
handlechild(uname){
this.setState({name:uname})
}
<Children cancal={uname=>this.handleChild(uname)}
子
componentDidMount(){
this.props.cancal('子传父')
}
父
this.state={name:''}
handlechild(uname){
this.setState({name:uname})
}
<Children cancal={uname=>this.handleChild(uname)}
子
componentDidMount(){
this.props.cancal('子传父')
}
本文标题:React-native 子传父
本文链接:https://www.haomeiwen.com/subject/rnnuoftx.html
网友评论