-
Couldn't load subscription status.
- Fork 31
Open
Description
A common issue I find is when using a when in a composable and not propagating the modifier parameter to all branches, typically when a new branch is added. For example:
@Composable
fun SomeScreenContent(
state: SomeViewState,
modifier: Modifier = Modifier,
) {
when (state) {
is SomeViewState.Loading -> SomeScreenLoadingContent()
is SomeViewState.Loaded -> SomeScreenLoadedContent(modifier)
}
}I'd like to see a warning/error on the is SomeViewState.Loading -> SomeScreenLoadingContent() branch saying that you probably want to pass the modifier parameter. The exception is if the composable doesn't accept a modifier.
Metadata
Metadata
Assignees
Labels
No labels