Tell us which versions you are using:
"react": "15.4.1",
"react-native": "0.39.2",
"react-native-router-flux": "3.36.0",
componentWIllMount and componentWillUnmount can be called
componentWIllMount and componentWillUnmount not called
note: data are fetched from server by the parameter in the componentWIllMount, if componentWIllMount is not called, it would cause wrong data at route B.
@aksonov Yes same in version 3.37.0.
If you have a list with items, when fast clicks to details after Actions.pop doesn't call componentWillMount
@aksonov Can you check this?
The problem persists in version 3.38.0
Is there any methods to solve this problem ?
Up, I got same problem ...is that just happen on 3.38.0 ?
Same problem here.
We have a temporary solution.
In our project, we have an init method for each component to set the state of that component.
It will be called in both componentWillMount and componentWillReceiveProps.
@twksos My solution is similar to you.
This may be related to https://github.com/aksonov/react-native-router-flux/issues/1266
@twksos could you please explain it more? I really appreciate it.
@golestanirad
I think the problem has gone if you upgrade to 4.0.
However, if there's some reason prevent you from upgrade, the old solution would looks like this:
class SomeView extends Component {
componentWillMount() {
this.init();
}
componentWillReceiveProps(nextProps) {
this.init();
}
init() {
// read props, set state, init view model ...
}
render() {
// ...
}
}
Most helpful comment
@aksonov Yes same in version
3.37.0.If you have a list with items, when fast clicks to details after Actions.pop doesn't call componentWillMount