what would be the equivalent of "onResume" for a ...
# compose
a
what would be the equivalent of "onResume" for a "screen" when using the navigation component ? A LaunchedEffect? . I wanna reset the scroll every time user returns to the screen
z
Yes, You can do it in
LaunchedEffect
passing
key1 = Unit
. Whenever you returns to the screen it will execute whatever you put in it.
y
Depends whether you actually want the exact behaviour. Those are not exactly the same.
Inside that launched effect, if you use repeatOnLifecycle, it should match closely
But I'm guessing a simple LaunchedEffect(Unit) is more like what you want to achieve