Skip to main content
Version: Next

RegisterModal

The register modal is used to create a new account.

Loading...

Usage#

import React from "react";
import {
RegisterModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const RegisterExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("register")}>Click to register</button>
<PelcroModalController>
<RegisterModal />
</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 user registers succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the register fails.