-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Closed
Labels
BugPartnerPlatform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.p: ExpoPartner: ExpoPartner: Expo
Description
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
Android users reported an issue on react-navigation that is caused by a component being mounted twice where we only expect it to be mounted once (react-navigation/react-navigation#4196). I dug into the root (no pun intended) cause and found that the problem was caused by the app root component mounting twice.
Environment
Environment:
OS: macOS High Sierra 10.13.4
Node: 9.2.0
Yarn: 1.5.1
npm: 5.7.0
Watchman: 4.7.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.0 AI-171.4408382
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
Steps to Reproduce
- Clone https://github.com/brentvatne/android-double-mount-repro OR just add logs to
componentDidMount
andcomponentWillUnmount
on the root component of a newreact-native init
app. - Open the project on Android:
react-native run-android
- Press the home button to go to the home screen, then tap on the app icon to open the app again
- Notice that in logs you will see the logs from
componentDidMount
- Reload the app (r, r) and notice that you will see
componentDidMount
log twice, butcomponentWillUnmount
does not ever get logged.
Expected Behavior
Root component should only ever be mounted once on app start
Actual Behavior
Root component is mounted twice on app start
averhulst, vikrantnegi, woowalker, AhmedFat7y, muratozgul and 13 more
Metadata
Metadata
Assignees
Labels
BugPartnerPlatform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.p: ExpoPartner: ExpoPartner: Expo