I have this parent snippet of code:
render(){
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home" >
{(props) => <HomeScreen {...props} scannedURL={this.state.scannedURL}/>}
</Stack.Screen>
<Stack.Screen name="Scan">
{(props) => <ScanScreen {...props} scanSuccess={this.scanSuccess}/>}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
);
}
when I update the state, this render method succesfully runs again, but my , which uses the parent state, does not re-render. Does anyone have any idea why? Is this a Navigator specific issue?
In HomeScreen I also have this:
this.state = {
scannedURL: props.scannedURL,
}
EDIT:
interestingly, in my HomeScreen component, whereI used this.state.scannedURL
, I replaced with this.props.scannedURL
and it worked? Is the constructor not running again? Im kinda lost