Hello all hope you are doing well.
How do you solve this issue when using compose multiplatform. I want to access a string resource from a coroutine
here is a solution for android.
In my code I currently go with
Copy code
val mealOrderedSnackbarMessage =
stringResource(MR.strings.side_effect_menu_meal_ordered_snackbar_message)
LaunchedEffect(Unit){
// access resources through local variable - mealOrderedSnackbarMessage
}
but I don't like it honestly
k
Khubaib Khan
06/13/2024, 12:27 PM
Here is a suggestion. Why are you using these resources now? We already have composeResources ?
d
Djuro
06/14/2024, 10:32 AM
You will face the same issue with
composeResources
, still needs to be a composable
k
Khubaib Khan
06/14/2024, 10:46 AM
You are doing in a wrong way. You can't pass any composable inside the SideEffects.