I am writing CustomSignUpView with Authenticator UI component in SwiftUI.
Can anyone give me an example of how to bind the PhoneNumber or Email fields to my TextField?
I tried the following but doesn't work
struct LoginScreen: View {
var body: some View {
Authenticator(
signUpContent: { state in
CustomSignUpView(state: state)
}
) { _ in }
}
}
struct CustomSignUpView: View {
@ObservedObject var state: SignUpState
var body: some View {
TextField("number", text: $state.fields[0].value)
}
}
I got the clean solution from Amplify team,