On compose 1.2.0-alpha03 writing this give me a co...
# compose
t
On compose 1.2.0-alpha03 writing this give me a compilation error saying
@Composable invocations can only happen from the context of a @Composable function
. It wasn’t the case in 1.1.0. Is this expected?
Copy code
buildAnnotatedString{
    withStyle(SpanStyle(....)){
        append(" • ${stringResource(key = "key", defaultValue = "Open now")}") //won't compile
    }
}
buildAnnotatedString {
    append(stringResource(key = "key", defaultValue ="Work time")) //compile
}
j
Hi, do you find out what’s the problem here?
s
It looks like a bug, is there a filed issue yet?
Meanwhile you can just:
Copy code
val index = pushStyle(SpanStyle(....))
append(" • ${stringResource(key = "key", defaultValue = "Open now")}")
pop(index)
t
I reverted to 1.1.1 so I don’t know If this is fixed on latest compose yet. I will check later this day if it’s still an issue I’ll file a bug
o