Open YashChauhan858 opened 4 months ago
Auto focus is not working when i passs the state and setState from the parent component but it works when it is internal to the component.
export default function OTP({ setOtp, otp }) { // const [otp, setOtp] = useState('')
return ( <OtpInput value={otp} onChange={setOtp} numInputs={4} inputStyle={'otp_input'} renderSeparator={-} renderInput={(props) => <input {...props} />} /> ) }
Auto focus is not working when i passs the state and setState from the parent component but it works when it is internal to the component.
export default function OTP({ setOtp, otp }) { // const [otp, setOtp] = useState('')
return ( <OtpInput value={otp} onChange={setOtp} numInputs={4} inputStyle={'otp_input'} renderSeparator={-} renderInput={(props) => <input {...props} />} /> ) }