this is the handler in question ```@Composable int...
# compose
v
this is the handler in question
Copy code
@Composable
internal fun BackButtonHandler(onBackPressed: () -> Unit) {
    Providers(
        AmbientBackPressedDispatcher provides LifecycleOwnerAmbient.current as AppCompatActivity
    ) {
        handler {
            onBackPressed()
        }
    }
}
i
Yeah, you don't want the
LifecycleOwnerAmbient
, you probably want to start with
ContextAmbient
Ideally, Compose just provides a
OnBackPressedDispatcherOwnerAmbient
that does exactly that for you
☝️ 1
1
v
Thanks a lot Ian! Let me give this a shot and see how far I get with it 😄
Is something like
OnBackPressedDispatcherOwnerAmbient
on the roadmap?
i
I'd be all for it. Do you mind filing an issue against Jetpack -> Compose?
v
Absolutely!
i
If you could paste a link to it here when you file it, I'll make sure it is routed to the right person
v
i
No