Forked from StevenCreates/usePasswordValidation.jsx
Last active
June 1, 2022 22:12
-
-
Save mfrancois3k/4b6e87d70d0aad3265e087c5d2959fee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useEffect } from "react"; | |
export const usePasswordValidation = ({ firstPassword = "", secondPassword = "" }) => { | |
const [validLength, setValidLength] = useState(null); | |
const [hasNumber, setHasNumber] = useState(null); | |
const [upperCase, setUpperCase] = useState(null); | |
const [lowerCase, setLowerCase] = useState(null); | |
const [specialChar, setSpecialChar] = useState(null); | |
const [match, setMatch] = useState(null); | |
useEffect(() => { | |
}, [firstPassword, secondPassword]); | |
} | |
return [validLength, hasNumber, upperCase, lowerCase, match, specialChar]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment