Skip to content

Instantly share code, notes, and snippets.

View vitaliyslion's full-sized avatar

Vitalii Pedchenko vitaliyslion

  • DataArt
  • Ukraine
View GitHub Profile
@Bloody-Badboy
Bloody-Badboy / OtpInput.tsx
Created March 12, 2022 15:12
A simple 6 digit OTP input using https://mui.com
import { Box, OutlinedInput } from '@mui/material';
import React, { useRef, useEffect } from 'react';
type Props = {
onChange: (res: string) => void;
};
const OtpInput: React.FC<Props> = ({ onChange }) => {
const inputsRef = useRef<Array<HTMLInputElement>>([]);