Skip to main content
Version: 3.14.0

UserUpdateModal

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

Note: If enableLoginWithUsername is set to true, the user will be able to edit their Username field.

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.