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

Nested navigators inside Tabs don't get disposed when the TabNavigator gets disposed. #402

Open
hristogochev opened this issue Apr 29, 2024 · 0 comments

Comments

@hristogochev
Copy link

hristogochev commented Apr 29, 2024

When disposing of a TabNavigator, the nested navigators inside each Tab don't get disposed.
This means that the ScreenModels inside each navigator don't get disposed as well.

I've solved the problem by taking the source code of the voyager-tab-navigator dependency and making some minimal changes.

The solution is published in this gist: Fix for Voyager TabNavigator not disposing of nested navigators.

Essentially, the solution involves mapping the nested navigator created inside each Tab to the Tab itself so that it can be disposed of when the TabNavigator is disposed.

If you need more than one nested navigator inside a tab, feel free to make the navigators a list instead, but I think this is enough.

This also helps partly resolve #396.

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

1 participant