How to pass values to other component in React-Native-Router-Flux?

后端 未结 5 1577
误落风尘
误落风尘 2020-12-08 06:44

My code is:

...

 


...
com1.js         


        
5条回答
  •  执念已碎
    2020-12-08 07:36

    you can use Actions with props

    onPress={() => Actions.com2({title: 'some title'})}
    

    and then in com2 you can retrieve the data like that

    this.props.title
    

    or you can use push property

     Actions.push('com2',{title: 'some title' } );
    

    then retrieve it in com2 also like that

    this.props.title
    

提交回复
热议问题