Join Slack
Powered by
The state is changing, but the recomposer doesn't ...
# compose
s
smallshen
07/12/2021, 9:55 PM
The state is changing, but the recomposer doesn't update the TextNode, any solutions?
a
Adam Powell
07/12/2021, 10:09 PM
If the snapshot where the state changes is not committed, the composition will not see the change reported. Compose UI sets this up to periodically commit the global snapshot transaction:
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/GlobalSnapshotManager.android.kt;l=20?q=GlobalSnapshot&sq=
s
smallshen
07/12/2021, 10:16 PM
I copied one and call it when using compose
smallshen
07/12/2021, 10:17 PM
the "Observer " is printing but the ui is not updating
smallshen
07/13/2021, 1:16 AM
solved
2
Views
Open in Slack
Previous
Next