How are people dealing with having lots of preview...
# compose
g
How are people dealing with having lots of preview functions in their compose files? Do people keep their composeables files quite small?
1
a
Yes. I tend to create a "big component" first, and create a previews for light and dark varitions. I do there a rough scaffold (not
Scaffold
) of component. When I detect a sub component that it's more complex I extract it to another file (mostly on
ui.widgets
package) and add there another previews
g
OK that makes sense, thanks!
j
Copy code
@Preview(name = "Night mode", uiMode = Configuration.UI_MODE_NIGHT_YES)
Does not work in my case, it returns a light mode preview anyways 🤷
1
d
To be honest the slow speed of @Previews has negated their usefulness for us. We've ended up disabling them in favour of just re-running the App. I wish it weren't so, but it's currently still faster that way. Could be because we also have a KMM shared module slowing down the tooling.