raamcosta / compose-destinations

Annotation processing library for type-safe Jetpack Compose navigation with no boilerplate.
https://composedestinations.rafaelcosta.xyz
Apache License 2.0
3.14k stars 129 forks source link

navargs.* cannot be imported in ArgsToSavedStateHandle.kt #631

Closed SorrowBlue closed 1 month ago

SorrowBlue commented 1 month ago

current version is 2.1.0-beta04.

navargs.* cannot be imported in ArgsToSavedStateHandle.kt. I have a Destination in another module that does not define NavArgs.

image

I can solve it by creating a meaningless Destination, but it's not pretty.
For Example:

// :tutorial module
@Destination<ExternalModuleGraph>
@Composable
internal fun EmptyScreen(value: Int = 0) {
    Text(text = "$value")
}

I'm having a problem with the following code.

// :app module
@NavHostGraph
internal annotation class MainGraph {

    @ExternalNavGraph<BookshelfNavGraph>(start = true)
    @ExternalNavGraph<TutorialNavGraph>
    @ExternalDestination<FavoriteAddScreenDestination>
    companion object Includes
}
// :tutorial module
@NavGraph<ExternalModuleGraph>
internal annotation class TutorialGraph

@Destination<TutorialGraph>(start = true)
@Composable
internal fun TutorialScreen(navigator: TutorialScreenNavigator) {
TutorialScreen(onComplete = navigator::onComplete)
}
raamcosta commented 1 month ago

Fixed! Should be up later today.

Thank you once again for reporting 🙏

raamcosta commented 1 month ago

beta05 are building. should be up in 30min or so