This file contains 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 React, { useState } from 'react'; | |
import WrongIcon from '../icons/wrongIcon'; | |
import CorrectIcon from '../icons/correctIcons'; | |
const PasswordInputWithValidation = () => { | |
const [password, setPassword] = useState(''); | |
const [errors, setErrors] = useState({ | |
minValueValidation: false, | |
numberValidation: false, | |
capitalLetterValidation: false, |
This file contains 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 React, { useRef, useEffect, useState } from 'react'; | |
const correctOTP = "123456" // validate from your server | |
function OtpInputWithValidation({ numberOfDigits }) { | |
const [otp, setOtp] = useState(new Array(numberOfDigits).fill("")); | |
const [otpError, setOtpError] = useState(null); | |
const otpBoxReference = useRef([]); | |
function handleChange(value, index) { |