Anyone had an issue with
stringResource
when using the formatArgs?
For example
stringResource(Res.string.mystring, param1, param2)
.
Sometimes it will return a previous instance of it, not with the new value of
param1
. Tested on the latest
v1.6.0-rc01
but still present.
Looking at the source code I don't even understand how it works:
fun stringResource(resource: StringResource, vararg formatArgs: Any): String {
val resourceReader = LocalResourceReader.current
val args = formatArgs.map { it.toString() }
val str by rememberResourceState(resource, { "" }) { env ->
loadString(resource, args, resourceReader, env)
}
return str
}
the "args" are only used within the remember, and this line is not called when I have the bug in my case.