Status Update
Comments
si...@google.com <si...@google.com> #2
Triage notes: Assigning for a response.
ve...@gmail.com <ve...@gmail.com> #3
When updating the providers, startProvider()
is comparing the new scope produces with the previous scope produced, instead of the current parent scope, to determine if the content of the provider needs to change, ignoring if the parent changed. That has the effect of, if a provider provides a value that is identical to the parent value, the composer thinks that none of the the static composition locals changed and it doesn't need to force updates of the content of the provider.
The temporary work-around for this is to use a compositionLocalOf
instead. Using compositionLocalOf
is recommended for composition locals that can change and static should are not recommended for values that can change.
However, in the above example, LocalOtherValue
only changes once so using a staticCompositionLocal
is recommended as it avoids the overhead for tracking reads of a value that rarely changes, making this work-around temporary for LocalOtherValue
or similar locals.
Description