I'm wondering if there's any way to optimize a lay...
# compose
v
I'm wondering if there's any way to optimize a layout like this to not destroy and compose ComplexSharedLayout from scratch?
Copy code
if (layout1) { Layout1(); ComplexSharedLayout() } else { Layout2(); ComplexSharedLayout() }
Any other possibilities than this?
Copy code
if (layout1) { Layout1() } else { Layout2() } ComplexSharedLayout()
1
Although in the specific example you gave I would go with your second suggestion (which only works if you don’t need more nesting of the composables)
v
TIL! Thanks, I knew something like this must exist but wasn't sure what to search for. The example is of course a very naive simplification of the actual situation