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

RNRF backAndroidHandler not work after calling RN BackHandler #3107

Closed
Chameehub opened this issue Jul 2, 2018 · 1 comment
Closed

RNRF backAndroidHandler not work after calling RN BackHandler #3107

Chameehub opened this issue Jul 2, 2018 · 1 comment

Comments

@Chameehub
Copy link

I use RN router-flux tab view and, for android hardware back button. I'm using both backAndroidHandler provided by RN-router-flux for handle back functions of tab view and react-native BackHandler for handle other components' hardware backpress. Both nicely work separately.

but when soon after the call of react native BackHandler, react-native-router-flux backAndroidHandler not functioning furthermore

RNRF - backAndroidHandler for handle tab View Back

<Router
    key="router"
    backAndroidHandler={() => {
      if (Actions.currentScene == "_dashboardView") {
        Alert.alert(
          'Exit',
          'Do you want to Exit?',
          [
            { text: 'No', onDismiss: () => { }, style: 'cancel' },
            { text: 'Yes', onPress: () => BackHandler.exitApp() },
          ],
          { cancelable: true }
        )

        return false;
      }
    }}>

RN - BackHandler for handle back press of normal layouts

BackHandler.addEventListener("hardwareBackPress", () => {
      // this.pageBackHandle();
      return true;
    });

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.24
  • react-native v0.50.3

Expected behaviour

backAndroidHandler - should handle back button for tab views
BackHandler - should work for normal layouts

Actual behaviour

If use backAndroidHandler before going to normal layouts it's working but after open normal layout which has used RN BackHandler and go back using RN BackHandler then here after RNRF-backAndroidHandler not working (If try to run back button function from tab view it's not working)

Steps to reproduce

  1. Create Tab view using RNRF and load normal layout from one of the tab
  2. Use backAndroidHandler for Routes.js to control Tab view back button,
  3. Use RN BackHandler for handle normal layout back button
  4. Run the project by using initial tab layouts then load normal layout from tabview
  5. Then press hardware back and go back using RN BackHandler
  6. Then check whether backAndroidHandler is working of Tab view. that is not working
@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

It is not supported, sorry

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants