current Composable Name
Returns the name of the current Composable, or you can define your own Composable name to use for ComposeInvestigator.
@Composable fun MyComposable() {
val table = currentComposableInvalidationTracer
val originalName = table.currentComposableName.name
assertEquals(originalName, "MyComposable") // Ok
table.currentComposableName = ComposableName("AwesomeComposable")
val newName = table.currentComposableName.name
assertEquals(newName, "AwesomeComposable") // Ok
}
Content copied to clipboard
This is used as the value of name in ComposableInformation.
If you call this getter from a Composable configured as an anonymous function, it will always be named 'anonymous.' Therefore, in this case, we recommend you specify your Composable name.