Skip to content

Instantly share code, notes, and snippets.

@StevenCreates
Created January 13, 2021 16:09
Show Gist options
  • Save StevenCreates/5624ebe0504aee60ccbebec4d9e34b97 to your computer and use it in GitHub Desktop.
Save StevenCreates/5624ebe0504aee60ccbebec4d9e34b97 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];
@satyarith
Copy link

hello
Sorry, where can i write it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment