react-native ios Podfile issue with “use_native_modules!”

Here is the correct answer: 1 – Your Podfile should contain this line on top require_relative ‘../node_modules/@react-native-community/cli-platform-ios/native_modules’ 2 – Make sure your package.json and node_module folders has this module installed cli-platform-ios/native_modules 3 – If you didn’t find after you run yarn install – means you have old cache node_modules in your machine and you need … Read more

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 2021: componentDidMount() { this.props.fetchData(); this.willFocusSubscription = this.props.navigation.addListener( ‘willFocus’, () => { this.props.fetchData(); } ); } componentWillUnmount() { this.willFocusSubscription(); } … 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

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