-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RenderContext passed into StatefulWorkflow#render is new instance every time #988
Comments
Problem first noted in #849 then we tried to fix in #850 but this had a bug because we were recreating anyway in order to get the I believe the reason we have these That being said, we always cast to a Will spike on this. |
Note that to currently handle this for lambdas passed in teh rendering to Composables, we box the lambdas on the Compose side like so:
So that we save the latest lambda but hide it from the other Composables until its invoked. |
Consider "Strong Skipping" - as discussed here - may make instance equality all we need for skipping - https://www.reddit.com/r/androiddev/comments/1an5emm/comment/kqf8dz0/ |
Found issue when digging into to recompositions with @steve-the-edwards:
When
render
is called in a StatefulWorkflow, a new instance of RenderContext is passed each time, causing compose to be unhappy about any lambdas that would capture the RenderContext (like foractionSink
calls).We believe this issue to be the cast on L172 of StatefulWorkflow.kt never succeeding and always requiring a wrapped
baseContext
The text was updated successfully, but these errors were encountered: