`OptIn` annotation seems to propagate the warning ...
# multiplatform
e
OptIn
annotation seems to propagate the warning anyway, is this a bug? Example:
Copy code
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CustomModalBottomSheet(
    <...>
) {
    androidx.compose.material3.ModalBottomSheet(...)
}

@Preview
@Composable
private fun Preview() {
    CustomModalBottomSheet(...) <--- This throws an error, expecting @OptIn too
}
In an Android-only project this works fine, in a multiplatform project this doesn't build and throws errors.
Copy code
agp = "9.0.1"
kotlin = "2.3.10"
c
Maybe it's one of the parameters that is annotated too?
e
yeah, you're right, how to deal with experimental parameters?
c
Add the
@OptIn
on the
Preview
function too.
e
This was just an example, I am using experimental composables in completely different modules that don't have material dependencies, so I can't use @OptIn, solved this by creating a wrapper for the experimental parameter