Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mfrancois3k/4b6e87d70d0aad3265e087c5d2959fee to your computer and use it in GitHub Desktop.
Save mfrancois3k/4b6e87d70d0aad3265e087c5d2959fee to your computer and use it in GitHub Desktop.
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