I just shipped jetc.dev Newsletter Issue #232! Compose 1.7.1 and Compose Multiplatform 1.7.0-beta02! Flow layouts! TV Compose! SharedBounds! Image cropping! And... why does remember() not seem always to remember?!? https://jetc.dev/issues/232 #JetpackCompose #AndroidDev
jetc.dev Newsletter Issue #232

Compose 1.7.1 and Compose Multiplatform 1.7.0-beta02! Flow layouts! TV Compose! SharedBounds! Image cropping! And... why does remember() not seem always to remember?!?

jetc.dev: Jetpack Compose Resources

@commonsguy Super interesting scenario with the remember not working as expected. In a way, and obviously only after I know the solution, it kinda makes sense that since you call the content lambda from two completely separate call sites it is treated as two separate compostables. While in the "solved" approach it's all in the same line.

But I can't say I can, with any confidence, answer why exactly that is and how the compiler is making that decision.

Thanks for sharing it!

@gakisstylianos You're welcome! It took me a few hours and a few profanities to figure it out! 😅
@commonsguy @gakisstylianos the slot lifecycle issue is a really tricky one. The next release of https://github.com/slackhq/compose-lints will have a new lint rule that should warn against some cases like this one which will lead to losing state.
GitHub - slackhq/compose-lints: Lint checks to aid with a healthy adoption of Compose

Lint checks to aid with a healthy adoption of Compose - slackhq/compose-lints

GitHub
@alex_vanyo @commonsguy a great reminder that I need to at some point actually sit down and include these checks to our codebase!