Skip to main content
Version: 1.0.0

PasswordChangeModal

The password change modal is used to change the user's password.

Loading...

Usage#

import React from "react";
import {
PasswordChangeModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const PasswordChangeExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("password-change")}>
Click to change password
</button>
<PelcroModalController>
<PasswordChangeModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onSuccess#

(userObject) โ‡’ void

Callback function called when the password is changed succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when changing the password fails.