How to correctly pass a parameter to a lambda in onClick using Jetpack Compose
I am trying to call a composable which has a parameter
This is the composable I want to call onClick
@Composable
fun ShowCustomChromeTab(articleUrl: String){
.......//it has a parameter
}
Now when user clicks on an item:
@Composable
fun ArticleItem(article: Article, onClick: () -> Unit){
Box(
modifier = Modifier
.clickable {
onClick(article.url)
},
)
This is how I am now using it
var shouldOpenChromeTab by rememberSaveable { mutableStateOf(false) }
var...