Fixed
Status Update
Comments
va...@gmail.com <va...@gmail.com> #2
Update: upon further investigation, it looks like Context receivers are the culprit behind these problems. If you remove the context receiver within a lambda block, recomposition occurs normally.
ti...@google.com <ti...@google.com> #3
Did you file a bug with JetBrains on Kotlin context receivers?
va...@gmail.com <va...@gmail.com> #4
This seems to be a bug with compose compiler, not kotlin context receivers as the receiver is generated correctly.
Description
Jetpack Compose version: 1.7.0-beta04 Jetpack Compose component used: Animation Android Studio Build: N/A Kotlin version: 2.0.0
We are using a custom crossfade implementation to only run animations when a type of the object changes to animate transitions between states in our UI.
However since upgrade to compose 1.7.0 (from 1.6.x) the content of the crossfade no longer recomposes correctly. Despite the incoming
state
changing, the content recomposes only if thecontentKey
changes, i.e. the type of the content.You can reproduce the issue by running the preview provided below
The A(0) and A(1) states are never visible. If you replace content key, the transition immediately starts working. If this was changed, then it's a breaking change and a replacement should be provided as we relied on correct recomposition of the content.