Skip to main content
Version: 2.7.0

UserUpdateModal

The user update modal is used to update the user's information.

Loading...

Usage#

import React from "react";
import {
UserUpdateModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const UserUpdateExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("user-edit")}>Edit profile</button>
<PelcroModalController>
<UserUpdateModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onPictureClick#

() โ‡’ void

Callback function called when the user clicks on their picture.

onSuccess#

(userObject) โ‡’ void

Callback function called when the user updates profile information successfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the update fails.