NavEaseHost
Navigation host for every @AutoRegister screen whose key belongs to the sealed root Root.
@Composable
fun App() {
NavEaseHost<AppScreens>(start = AppScreens.Splash, onExitRequest = { finish() })
}Each host owns an independent back stack, controller and result store, so nested hosts for different roots never see each other's screens.
After a build, KSP generates a same-named overload for each of your roots. It is strictly more specific than this declaration, so NavEaseHost<AppScreens>(...) binds to the generated one, which initialises the screen registry before delegating back to NavEaseHostForRoot. This declaration exists so your code still resolves in the IDE before the first build, and so that a call which somehow misses the generated overload fails with a clear message rather than a blank screen.
Parameters
The key placed on the back stack first.
Called when back is pressed on the root screen.
true to wrap the host in a SharedTransitionLayout.
Default screen-to-screen animation.
Called with NavEaseController as receiver whenever the top of the back stack changes, including on first composition.
Type Parameters
The sealed key class whose screens this host serves.