So I have this screen that show product details, it works like a template because only the data coming navigation params changes, I am having the issue because there's no reload, it works fine when going back and mounting it again, that's not the case here since I have related products showing on that same screen, I'll need a way to be able to either reload the current route or update the state
I have checked with console.log nothing shows up on second click
constructor (props) {
super(props)
this.state = {
product: this.props.route.params.product,
id: this.props.route.params.product.id,
}
}
To navigate to use to the route I use on both the screen itself or in another route
viewProduct = (product) => {
this.props.navigation.navigate('SingleProduct', { product: product })
}
I have tried setState inside of both componentDidMount
and UNSAFE_componentWillReceiveProps
but the results only shows after an additional click