https://kotlinlang.org logo
#compose
Title
# compose
n

Nick Kleban

11/15/2023, 11:03 AM
Hello everyone! I’ve read on stackoverflow this statement about lambdas in compose
Copy code
Lambda memoization is done automatically by the compiler by generating a remember call implicitly based on the stable values captured by the lambda.
My question is it ok to write code like this without remember?
Copy code
@Composable
override fun SomeScreen() {
    val someLabmda = { /* No params, 1 CompositionLocal call*/ }

    SomeComponent( //Composable function
        ...,
        someLabmda
    )
}