Refresh previous screen on goBack()

Adding an Api Call in a focus callBack in the screen you’re returning to solves the issue. componentDidMount() { this.props.fetchData(); this.willFocusSubscription = this.props.navigation.addListener( ‘willFocus’, () => { this.props.fetchData(); } ); } componentWillUnmount() { this.willFocusSubscription.remove(); } UPDATE 2023: willFocus event was renamed to focus componentDidMount() { this.props.fetchData(); this.focusSubscription = this.props.navigation.addListener( ‘focus’, () => { this.props.fetchData(); } … Read more

componentWillMount is deprecated and will be removed in the next major version 0.54.0 in React Native

You should move all the code from the componentWillMount to the constructor or componentDidMount. componentWillMount() is invoked just before mounting occurs. It is called before render(), therefore calling setState() synchronously in this method will not trigger an extra rendering. Generally, we recommend using the constructor() instead. Avoid introducing any side-effects or subscriptions in this method. … Read more

`React/RCTBridgeModule.h` file not found

In my case this particular problem happened when I was trying to archive a 0.40+ react-native app for iOS (solution was found here: Reliable build on ^0.39.2 fails when upgrading to ^0.40.0). What happened was that Xcode was trying to build the react-native libraries in parallel and was building libraries with implicit react dependencies before … Read more

What is the difference between Expo and React Native?

When you write code in Expo you are writing React Native code. Expo has two main pieces: Expo CLI (expo-cli): a developer tool for creating projects, viewing logs, opening on your device, publishing, etc. Expo client: an app on your phone that lets you open your projects while you’re working on them, without needing to … Read more