AmplifyConfirmSignIn - How to call default handleSubmit condition when customizing
See original GitHub issueIs your feature request related to a problem? Please describe.
Per documentation the default handleSubmit will call this.confirmSignup(event)
I would like to do some custom function calls AFTER the user successfully confirms his or her account. I am unable to get access to this.confirmSignup(event)
and tried to use the aws-amplify
Auth object to call it but that does not work saying I have the wrong parameters. How do I call the parent component (AmplifyConfirmSignIn) handleSubmit function in my custom function and get that return value?
function Root() {
handleSubmit(event) {
event.preventDefault();
// Call this.confirmSignup(event);
console.log('do custom stuff')
}
return (
<AmplifyAuthenticator>
<AmplifyConfirmSignIn
headerText="My Custom Confirm Sign In Text"
slot="confirm-sign-up"
handleSubmit={handleSubmit}
>
</AmplifyConfirmSignIn>
</AmplifyAuthenticator>
)
}
Describe the solution you’d like I think having a ref to this component can be make the parent component function accessible.
Describe alternatives you’ve considered I tried using the aws-amplify library directly but that does not work either.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
The request to be able to access and call the default handler needs to be added to all the handlesubmit events. ie, sign up, sign in, sign out, etc.
Right now if you hook the handlesubmit event you lose the ability to use the base functionality as well.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.