olshevski / compose-navigation-reimagined

🌈 Type-safe navigation library for Jetpack Compose
https://olshevski.github.io/compose-navigation-reimagined/
MIT License
542 stars 18 forks source link

CreationExtras integration #10

Closed equeim closed 2 years ago

equeim commented 2 years ago

androidx.lifecycle 2.5 added new API for easier creation of custom ViewModel factories. It needs some integration from this library.

Namely, NavHostEntry needs to override getDefaultViewModelCreationExtras() method to set default CreationExtras keys that users expect to be present (application, saved state registry owner, etc). Here is how ComponentActivity does that: https://github.com/androidx/androidx/blob/7f29447f3add52b6db69524dfa944dd1b0a8828b/activity/activity/src/main/java/androidx/activity/ComponentActivity.java#L641

olshevski commented 2 years ago

Support added in 1.2.0.