UNPKG

react-native-confirmation-code-field

Version:

A react-native component to input confirmation code for both Android and IOS

12 lines (11 loc) 320 B
import { useEffect, useRef } from 'react'; export const useBlurOnFulfill = ({ value, cellCount, }) => { 'use memo'; const inputRef = useRef(null); useEffect(() => { if (value?.length === cellCount) { inputRef.current?.blur(); } }, [value, cellCount]); return inputRef; };