In Fragment lifecycle, we have onCreateView
and onViewCreated
.
What is the correct alternative for these lifecycle methods in jetpack compose?
Should I use LaunchedEffect(true)
for both or are there different ways to handle these lifecycle callbacks?
Edit 1.
The main focus of this question is to understand if there is any difference in handling those two fragment lifecycle methods.
The taged question does not explicitly answer my question.
Philip's comment below does.
In the declarative way there's no need to listen onViewCreated
, because you can declare all needed composables with relationships without waiting it to be "created" or rendered.
And yes, LaunchedEffect
is the compose way of doing that.