Anyone can help me to implement shared textfield s...
# multiplatform
p
Anyone can help me to implement shared textfield state between Swftui/Compose , the current impl is working however in swiftui there is some langing and the validation color is not updating unit I moved to the next textfield My viewmodel
Copy code
fun onFirstNameChange(text: String) {
    setState {
        copy(
            firstName = Name(text)
        )
    }
}
swiftui
Copy code
var binding : Binding<String> { Binding<String>(
    get: {
      self.text
    }, set: {
      onTextChange($0)
    })
  }

TextField( "", text: binding.max(limit: maxCount, textCountWithoutFormat: textCountWithoutFormat) )
           .foregroundColor( isValid ? Neutral50 : Red )