Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to close down app correctly in multiple scenarios on iOS #26457

Closed
eventengineering opened this issue Sep 16, 2019 · 3 comments
Closed
Labels
Bug Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@eventengineering
Copy link

The function for detecting when a component will be unmounted seems to never be fired on the root component, or a navigation component.

My root component has a very simple componentWillUnmount with just a console log line, and a similar one exists inside the navigation route open at the time. As it stands, neither of these are called in debug when the app reloads the JS from the bundler, when the app is closed from Xcode, nor when the app is closed within iOS

React Native version:

 React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
      Memory: 1.21 GB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
      npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
    IDEs:
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: 0.57.8 => 0.57.8
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native: 0.59.5

Steps To Reproduce

  1. Run the following App.js on an iOS device from Xcode
  2. Enable auto-refresh
  3. Add a new line somewhere in the App.js
  4. Notice no unmounting log line
  5. Close the app
  6. Notice no unmounting log line
import React, {Component} from 'react';
import {AppState, View} from 'react-native';

//return navigator
export default class App extends Component {
	componentDidMount() {
		console.debug('!!! App Mounted');
	}

	componentWillUnmount () {
		console.debug('!!! App Unmounting');
	}

	_handleAppStateChange(nextAppState) {
		console.debug('!!! App state', nextAppState);
	}
	
	render() {
		console.debug('!!! App Rendering');
		AppState.addEventListener('change', this._handleAppStateChange);
		return <View></View>;
	}
}
@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.60 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@eventengineering
Copy link
Author

Would love to, but your latest version doesn't work (see #26409)

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Oct 11, 2019
@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@facebook facebook locked as resolved and limited conversation to collaborators Oct 3, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants