Need help/suggestion on what is the ideal way to d...
# compose
a
Need help/suggestion on what is the ideal way to deal with TabRow, Lists and HorizontalPager.
I have a
Copy code
listOf("Tab 1", "Tab 2", "Tab 3")
Which I am using for a
TabRow
with a
Copy code
HorizontalPager( .. ) { index ->
    when (index) {
        0 -> Tab1()
        1 -> Tab2()
        2 -> Tab3()
    }
}
My question is regarding the list of tabs (name of tabs). Where would I keep the list? Would a new list be created on every recomposition? Do I need to remember the list? Also, there's a special case where I need to omit
Tab 1
. On that special case the result would look like
Copy code
listOf("Tab 2", "Tab 3")
..
HorizontalPager( .. ) { index ->
    when (index) {
        0 -> Tab2()
        1 -> Tab3()
    }
}
Would a write a separate composable for this? What's the ideal way to deal with this? Would if-else be accepted?