gaearon / gaearon/react-side-effect

Tab Navigation + Different Tab Stack Lengths

Open
#55 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
74
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'm trying to use this wonderful library to implement the Android Back Button functionality mentioned in [this blog article](https://medium.com/the-many/handling-android-back-button-events-in-react-native-with-custom-components-b33c63b0633b).

Problem is, my use case is a little different, it can't automatically use the "last mounted" component I use for catching the back button event, it needs to use the one of the currently focused screen.

---

For example, this works:
1. `Tab A`: `Tab A Root`
2. `Tab B`: `Tab B Root` > `Screen B` <- focused, back button here, listener of Screen B called correcty
3. `Tab C`: `Tab C Root`

While this is not working:
1. `Tab A`: `Tab A Root`
2. `Tab B`: `Tab B Root` > `Screen B` <-- focused, back button here, **listener of Subscreen C is called**
3. `Tab C`: `Tab C Root`> `Screen C` > `Subscreen C`

Any ideas how this scenario could be handled? Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.