Is there some general consensus on appending “size...
# compose
f
Is there some general consensus on appending “size modifiers” - eg.
fillMaxWidth()
to the modifier passed to a composable?
Copy code
@Composable
fun MyComponent(modifier: Modifier = Modifier) {
    Box(modifier = modifier.fillMaxWidth()) {
        // ...
    }
}
On one hand, it feels like it hurts reusability, on the other it can remove some duplication. WDYT? Valid usage, frowned upon, should be avoided?
n
There is some insight here https://chris.banes.dev/always-provide-a-modifier/ . At the same time, we do this every time and experienced no issue whatsoever, not even an unexpected size during development in the past year. This is because not all composables you write are going to be reusable/reused, and for those that do, often they really need to fill that max width. It boils down to how best-practicey you strive to be.