ChangeEmailForm
Change the sign-in email; re-authenticated via current password.
import { ChangeEmailForm } from "@evolve-storefront/feature-account/change-email-form";Renders inside AccountProvider.
Preview
Usage
const { formProps } = useChangeEmailForm({ onEmailChanged: close });
<ChangeEmailForm {...formProps} onCancel={close} />;Props
| Prop | Type | Description |
|---|---|---|
onValidSubmit | (values: { email: string; password: string; }) => void | |
validationBehavior? | "aria" | "native" | Default |
defaultValues? | Partial<{ email: string; password: string; }> | |
isPending? | boolean | |
error? | string | null | |
serverErrors? | FormValidationErrors | |
onCancel? | (() => void) |
Any other props go to the root element, like on a plain HTML element.
Examples
With ErrorWrong current password (server error surfaced form-level).
// `useChangeEmailForm` maps a wrong current password into formProps.error.<ChangeEmailForm onValidSubmit={change} error={errorMessage} />;
