Thread
#compose
    Mikołaj Kąkol

    Mikołaj Kąkol

    1 year ago
    How we should use
    Modifier
    that is passed to compose function. What the idea there? Should it be passed to first composable function, or to most inner function? Should we treat it like
    layoutparams
    , so it’s for the most outer composable? Is it okay to pass multiple
    Modifiers
    to different composables?
    what I’m really asking, is what are the best practices, is there a documentation regarding Modifiers usage? It’s quite broad topic, and it’s hard to assume stuff
    Javier

    Javier

    1 year ago
    I think there are answers for this question in a codelab, or in docs, but I don't remember exactly where
    Mikołaj Kąkol

    Mikołaj Kąkol

    1 year ago
    Okay that is helpful, but what if we need to pass modifier to some child, is it an antipattern to do that?
    matvei

    matvei

    1 year ago
    Do you have a control over what child this will be or it's just a generic slot?
    Mikołaj Kąkol

    Mikołaj Kąkol

    1 year ago
    Considering an compose function to draw input. How should I style text over the input or error message
    matvei

    matvei

    1 year ago
    Do you have a code example in mind?
    Mikołaj Kąkol

    Mikołaj Kąkol

    1 year ago
    Not really, what I'm thinking is that we have a custom input,that shows text above and under. Just like the material one. How should we customize behavior of those additional text? Or let say a click to that text.
    matvei

    matvei

    1 year ago
    If that's a part of the child composable contract, it can just accept
    onUnderTextClick : () -> Unit
    or smth. What we consider an anti pattern is when you have more than 1 modifier for one child, because you want to customize more than one part of the component from the parent. Usually it's a sign that the child is not a self-contained element and it can be either more opinionated about its functionality or can be split into >1 pieces.
    Mikołaj Kąkol

    Mikołaj Kąkol

    1 year ago
    Thank you ☺️