Shivam Verma
11/03/2023, 5:54 AMCustomButton(
text: String,
onClick: () -> Unit,
modifier: Modifier
)
However, when setting the accessibility label, user needs to use Modifier.clickable(..)
which then conflicts with the onClick
parameter. How would you design the api in this case?curioustechizen
11/03/2023, 6:54 AMShivam Verma
11/03/2023, 7:03 AMThat said, the compose API guidelines state that every component should expose a modifier parameter anyway.Yeah, this also seems to be a good long term solution so as to not end up in the rabbit hole of updating the api whenever a new modifier needs to be set. However, in that case, it seems the solution would be to not have
onClick
as a parameter at all and force the consumers to always use Modifier.clickable()
.