simple-authentication-react
v2.0.0
Published
A simple react authentication component.
Readme
Simple authentication react
Table of contents
Installation
pip install simple-authentication-reactDependencies
npm i react-hook-form
npm i yup
Usage
- Required for styles :root { --primary-color: #f01159; --secondary-color: #dff8fe; --third-color: #003458; --fourth-color: #82cde5; }
import { Login, SignUp } from "simple-authentication-react";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";
<Login
setIsLoggedIn={setIsLoggedIn}
yup={yup}
yupResolver={yupResolver}
submitForm={submitForm}
schema={loginSchema}
fields={fields}
/>Props
- setIsLoggedIn - to invert state from signin and signup
- yup - for validation
- yup - for passing validation schema
- submitForm - to call api or validation
- schema - yup schema depending on the field present in the form
- fields - fields that must be present in the form
