I have two screens. Home and PhotoDetails. On the Home I have photo list. I want to update the likes on the Home screen if I was like photo on the PhotoDetails screen. Without updating the entire page. Can I use a callback between screens? how? I'm using StackNavigator. thanks for the answer
<TouchableHighlight
onPress={() => navigate('PhotoDetails', {
id: rowData.caption.id,
tag: rowData.caption.text,
url: rowData.images.standard_resolution.url,
likes: this.state.likes[rowData.caption.id] || 0
})}>
<Image
source={{uri:rowData.images.standard_resolution.url}}
style={{width: 320, height: 320}}/>
</TouchableHighlight>
<Like
onPress={()=> {onLike(this.state.id).then((newLikes)=>{
this.setState({
likes: newLikes
})
})}}
likes={this.state.likes + '' || '0'}
/>