React-native-navigation: [V2][Android] Awful, Probably Global Bug (resets default options after exiting app with hardware back button on android)

Created on 26 Jan 2019  路  5Comments  路  Source: wix/react-native-navigation

Issue Description

When you "exit" (but not terminate, so it runs in the background) the app with hardware back button on android, and then open it again, all setting set in Navigation.setDefaultOptions({ ... }) will go back to the Wix's default - bottom-to-up push transition, white tab bars etc...

This doesn't happen when you exit the app using the home (the circle) button on android, or any other way. It happens only when you exit the app with back button.

Steps to Reproduce

If you have an app with react-native-navigation v2 and some options set in

Navigation.setDefaultOptions({ ... });

Set for example custom bottom tabs colors, and custom push transition.

screenshot_2019-01-26-20-14-52

Then run the app on android, "exit" app with hardware back button (not any other way) so the app isn't "hardly closed" but it still runs in the background.
Then "restore" the app by either clicking the app icon or picking it from recently opened apps and you'll see that all options you set in setDefaultOptions are ignored and reverted to Wix's defaults. Bottom tabs are white, custom transitions are ignored etc...
screenshot_2019-01-26-20-15-02

Yes, this happens in release build too.

This is awful bug and if you've built an app with RNN v2 for Android, you should quickly check if it happens for you too and let me know.


Environment

  • React Native Navigation version: 2.7.0
  • React Native version: 0.57.8
  • Platform(s): Android, not tested on iOS
  • Device info: Physical Device(LG K10 / K420N), Android 6.0, Both Debug and Release

Most helpful comment

the best solution I found is to dump React Native and go Flutter! Cya all!

All 5 comments

Any update on this or how to fix it?

no, I still have this A W F U L bug.

I'm thinking about fixing it by overriding backhandler event and ask user "Are you sure you want exit this app?" and if so then TERMINATE the app so when he opens it again, it will open properly.

But I haven't tried to implement this yet.

This bug also happens when the app is opened by a link or redirected back to like in "Login with Facebook" flow. Once the app should open again after successful login there is just a clear white screen 馃様 no idea how that would could be overridden so the app wouldn't lose it's current state

I got the same issue on Android too (Standby from background to Active state ). If there's no official update to fix this issue, I think I have to create a function which called in every page (componenetDidMount) to ensure the setting is set as what I defined on App or Index (js) file.

the best solution I found is to dump React Native and go Flutter! Cya all!

Was this page helpful?
0 / 5 - 0 ratings