What limitation? This is indeed how you would simplify your code or create reusable UI chunks
k
Kyant
08/30/2020, 4:18 AM
@romainguy For example the
@Composable MyButton(onClick, text, icon)
function, except label and icon I can't add more things to it. I don't want to change original function.
So I think my custom function is unnecessary. 😔
r
romainguy
08/30/2020, 4:19 AM
You can make your new function accept one or more composable lambdas (what we call "slots") so the caller can customize the content
romainguy
08/30/2020, 4:20 AM
Which is exactly what you do with IconButton, you pass a lambda to put an Icon inside