demand is like this
has three card heads, merchandise, details, comments
and corresponding card body
now, when you click on the card head, you need to automatically move to the card body
I use the scrollTo ({x: 0Powery: 0, animated: true})
method to move
because some card bodies use redux, so you can"t use this.refs.xxx.goTop () to control movement (xxx is a component of the whole commodity or details, goTop is one of the methods. goTop () {this.refs.box.scrollTo ({x: 0J y: 0, animated: true})
, where box is a scrollView, in the product
my idea is that when clicking on the card header, in the corresponding card body, store a tag where, value in redux that is the product (commodity), details (detail), comments (evaluation)
execute
this.refs.xxx.scrollTo ({.}) in the commodity component by determining whether it is commodity in the life cycle of componentWillReceiveProps, as follows
componentWillReceiveProps(props){
if(props.where == "commodity"){
this.refs.xxx.scrollTo({...})
}
}
but here"s the problem. Any props changes in this component will start this.refs.xxx.scrollTo ({.})
do you gods
have ways or ideas to just listen for where changes?
is it urgent, online, etc., thank you