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

Navigation restarts when host Fragment gets restored #334

Open
Miha-x64 opened this issue Jun 18, 2024 · 1 comment
Open

Navigation restarts when host Fragment gets restored #334

Miha-x64 opened this issue Jun 18, 2024 · 1 comment

Comments

@Miha-x64
Copy link
Contributor

If we're inside a Fragment, ComposeView gets destroyed when we're put to back stack and re-created when popped back. Under these circumstances remember() forgets everything but rememberSaveable() still works.

LaunchedEffect(builder, initialRoute) {
navigator.setRouteGraph(
RouteBuilder(initialRoute).apply(builder).build(),

LaunchedEffect() relies on remember(). Thus, navigation gets restarted, and even rememberSaveable() are useless inside destinations.

@Tlaster
Copy link
Owner

Tlaster commented Jun 19, 2024

It might be better to find a new way to initialize the route graph, currently PreCompose still want to reset the route graph when builder or initial Route changed.

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