import React, { forwardRef, useEffect, useRef } from 'react'; export default forwardRef(function TextInput( { type = 'text', name, value, className, autoComplete, required, isFocused, handleChange }, ref ) { const input = ref ? ref : useRef(); useEffect(() => { if (isFocused) { input.current.focus(); } }, []); return (