I'm trying to create a TextField reusable component so I did this
@Composable
fun TextFieldComponent(state: Any, placeholder: String) {
TextField(
value = state,
onValueChange = { textFieldValue -> state = textFieldValue },
placeholder = { Text(placeholder, color = MaterialTheme.colors.secondary) }
)
}
but I'm getting these errors
and that's how I'm calling the component
val textFieldState by rememberSaveable { mutableStateOf("") }
TextFieldComponent(state = textFieldState, placeholder = "Email")
so is there any fix?
