You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think to make any reasonably sized app using Render, I would need the ability to nest ComponentViews inside other ComponentViews. (The strategy in the ReadMe of using a function that returns a ComponentNode is insufficient because the inner Component needs to also be able to track and update its own state.)
There are no examples that I can see in the repo, so I've taken a stab in a way that makes sense intuitively. However, there seems to be an issue that the inner view thinks the parent view's size (referenceSize) is (0,0). Here's a simplified playground:
With this code, I'd expect to see a blue view inside a green view inside a red view, which I do. But also, the blue view should expand to fill the size of its green container (- margin space), because flex = 1. Like so:
However, the inner blue view thinks that it's parent's size is (0,0), so I instead get this:
The flex property ends up being meaningless and the view just takes the size of its minDimension. (Inexplicably, though, the horizontal layout is still correct?)
My question: Is this how I should be creating nested ComponentViews? Am I missing some technique here? Could the problem be that renderComponent never gets called on the innerView, and if so, where should I put that call?
The text was updated successfully, but these errors were encountered:
Hello!
You did nothing wrong, unfortunately I had to fix a bunch of issues related to flexbox.
I tried this today and it seems to be fixed with the new css-layout C source from fb.
The exposed flexbox API is a bit different and more consistent with the web implemenation.
This work as expected though.
I think to make any reasonably sized app using Render, I would need the ability to nest ComponentViews inside other ComponentViews. (The strategy in the ReadMe of using a function that returns a ComponentNode is insufficient because the inner Component needs to also be able to track and update its own state.)
There are no examples that I can see in the repo, so I've taken a stab in a way that makes sense intuitively. However, there seems to be an issue that the inner view thinks the parent view's size (
referenceSize
) is (0,0). Here's a simplified playground:With this code, I'd expect to see a blue view inside a green view inside a red view, which I do. But also, the blue view should expand to fill the size of its green container (- margin space), because flex = 1. Like so:
However, the inner blue view thinks that it's parent's size is (0,0), so I instead get this:
The flex property ends up being meaningless and the view just takes the size of its minDimension. (Inexplicably, though, the horizontal layout is still correct?)
My question: Is this how I should be creating nested ComponentViews? Am I missing some technique here? Could the problem be that
renderComponent
never gets called on the innerView, and if so, where should I put that call?The text was updated successfully, but these errors were encountered: