父组件

  testEvent = () =>{
    console.log('abc123')
  }

 <Test test={1231323} onTestEvent={this.testEvent}></Test>

 子组件

  abc(){
    this.props.onTestEvent();
  console.log(this.props.test) } render () { return ( <View onClick={this.abc}> {this.props.test} </View> ) }

 

相关文章:

  • 2021-11-14
  • 2021-10-24
  • 2021-08-15
  • 2021-10-07
  • 2022-01-14
  • 2021-10-11
  • 2021-11-13
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2021-05-08
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-02-02
相关资源
相似解决方案