I am using react-native with react-native-navigation. I would like to reload data when a component is shown. The component is shown when a user clicks on a tab navigation button
I like the solution proposed by Bruno Reis. I tweaked mine to make it a bit simpler.
class Whatever extends Component { componentDidMount(){ this.load() this.props.navigation.addListener('willFocus', this.load) } load = () => { ... } }