Hi all, I was wondering what's the proper way to h...
# compose
s
Hi all, I was wondering what's the proper way to handle composables which may have different components inside and may have a slightly different behavior - it is better to differentiate them by their name (e.g.
PrimaryButton
,
PrimaryIconButton
) with more LOC as side effect, or by taking multiple parameters (
PrimaryButton(icon: Int?)
) with more control flow structures and overall complexity as a side effect?
a
would it ever make sense for the same instance of the composable to change that behavior in place when it recomposes with a different parameter? If yes, prefer those parameters. If no, prefer separate composables.
s
Thanks!
👍 1