you just made a minor mistake.
In customloginField, you need to define inputStr: String as a binding variable
@Binding var inputStr:String
and while using, you have to use it as following
CustomLoginField(inputStr:self.$phone, keyboard: .numberPad, placeholder:"PHONE", formatedPhoneNumber:true, maxLength: 10)
CustomLoginField(inputStr:self.$password, keyboard: .numberPad, placeholder: "PASSWORD", isSecure: true, maxLength: 4)
Noticed “$” before phone & password?
Check below SO thread for the @state vs @binding SwiftUI @State vs Binding
CLICK HERE to find out more related problems solutions.