Comments (4)
Can you show me the exact code to navigate and pop up that youβre trying?
from compose-destinations.
so backstack was produced by navigate(List())
and then i want to navigate back, but with
navigator.navigateUpTo(List(id = 123))
i'm using this extension function
fun DestinationsNavigator.navigateUpTo(
destination: Direction,
) {
navigate(direction = destination, builder = {
this.popUpTo(destination.route, popUpToBuilder = {
this.inclusive = true
})
})
}
from compose-destinations.
Yeah, so Direction
has information about nav args (that's why when you have a Destination and invoke it, it gives you a Direction you can then pass to navigate to). Route
doesn't (DestinationSpec
and NavGraphSpec
are Route
).
Your extension function doesn't work because you're navigating to a Direction
(even though you're calling it "destination") and trying to pop it up from the back stack.
What you need to do is:
navigator.navigate(YourDestination(args)) {
popUpTo(YourDestination) {
inclusive = true
}
}
from compose-destinations.
thanks for the clarification - will try that π
from compose-destinations.
Related Issues (20)
- Accompanist Navigation Material functionality now available in androidx.compose.material.navigation.* HOT 2
- "Reproducible build" possible with Compose Destinations? HOT 5
- Multiple Backstacks HOT 1
- [Improvement] moduleName could be automatically raname to "main" HOT 1
- Multiple NavGraphs with shared routes on V2 HOT 1
- Sharing a view model between destinations but with a view model factory HOT 3
- Multiple DestinationsNavHost
- upgraded from 2.0.0-beta02 to 2.0.0-beta09 HOT 13
- Crash when using Parcelable class as navigation argument HOT 6
- [KSP] Destinations generation issue HOT 1
- Standalone Sealed Classes as NavArgs in Android HOT 5
- Could not find Navigator with name "BottomSheetNavigator". You must call NavController.addNavigator() for each navigation type HOT 1
- Handle different scheme for debug and release build HOT 1
- Deeplink to nested graph destination not working HOT 3
- Build failed: Only safe or non-null asserted calls are allowed for custom `@NavTypeSerializer` HOT 3
- Destination argument names instead of values are passed when values are null HOT 2
- (Open)ResultRecipient seems to cause recompositions HOT 1
- Pass/Access ContentPadding in Child-Destinations HOT 1
- Original Question: Is this project (basically) dead? Answer: Definitely not! Exciting things are coming! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-destinations.