Skip to main content
Version: 1.0.0

RegisterContainer

Handles authenticating a registered user on your site.

Usage#

import React from "react";
import {
RegisterContainer,
RegisterEmail,
RegisterPassword,
RegisterButton,
Alert,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const CustomRegisterView = () => {
return (
<RegisterContainer
onSuccess={(userObject) => {
console.log(userObject);
}}
onFailure={(err) => {
console.error(err.message);
}}
>
<Alert />
<label>Email: </label>
<RegisterEmail />
<label>Password: </label>
<RegisterPassword />
<RegisterButton />
</RegisterContainer>
);
};

Reference#

RegisterContainer#

Props#

onSuccess#

(userObject) โ‡’ void

Callback function called when the user registers succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the register fails.

Children components#

Alert#

Displays the relevant errors or success messages.


RegisterEmail Required#

Instance of Input

Input field component to receive the email of the user.


RegisterPassword Required#

Instance of Input

Input field component to receive the password of the user.


RegisterButton Required#

Instance of Button

A button component that submits the register form.

Props#

name#

string?

The title displayed inside the button