Skip to content
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

Adding layout attributes to an already measured component doesn't work #83

Closed
emilsjolander opened this issue Apr 12, 2017 · 1 comment

Comments

@emilsjolander
Copy link
Contributor

When calling Layout.create(c, component) after the component has been measured, it causes the subsequent attribute (including the click handler) to be lost.

What happens is that we end up with two internal nodes for the same components and it doesn't work out well. The problem relates to returning early when we call LayoutState.collectResults() and InternalNode.isNestedTreeHolder() returns true, which is the case when we already have a cached layout for the component associated with the node.

Code pointers

https://github.com/facebook/litho/blob/master/litho-core/src/main/java/com/facebook/litho/LayoutState.java#L447

https://github.com/facebook/litho/blob/master/litho-core/src/main/java/com/facebook/litho/InternalNode.java#L369

Point of contact: @marco-cova

@colriot
Copy link
Contributor

colriot commented Jun 4, 2019

We have Wrapper class for that.
Closing

@colriot colriot closed this as completed Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants