React-native-navigation: How to refresh the parent screen

Created on 25 Jan 2018  路  2Comments  路  Source: wix/react-native-navigation

Navigate Back or pop doesnt fire componentmount,componentWillUpdate, componentWillReceiveProps ,... etc

Let me know how to rerender or refresh the parent screen(ie state need to be updated) when back button is pressed.

For example, I have a ListItem and Add Item screen and it navigates as ListItem > AddItem

when an Item is added in AddItem screen and on pressing back button, List Item screen need to get refreshed.

It would be good to have passProps in pop(), which might fire componentWillReceiveProps.

this.props.navigator.pop({
...
passProps: {},
...
})

Most helpful comment

how to reload screen in react-native

All 2 comments

This problem could be solved by either sync the data using Redux/MobX or listen to visibility events

how to reload screen in react-native

Was this page helpful?
0 / 5 - 0 ratings