hey I'm building an editor toolbar so I need to pa...
# compose
m
hey I'm building an editor toolbar so I need to pass
MaterialTheme.Typography
through
data class
property
and it's not possible because the
MaterialTheme.Typography
is a
Composable
so we can't use it in
non-composable
. and now the question is how can I achieve that? the code is in thread to take less space.
data class:
Copy code
@Stable
internal data class Format(
    val title: String,
    val value: String,
    val textStyle: TextStyle? = null
)
usage:
Copy code
title = "Heading 1",
    value = "h1",
    textStyle = MaterialTheme.typography.h1
)