I don\'t know if I\'m doing this correctly... If I want to get value from an input I use this.refs.whatever.value.trim() but if that input is a stateless function component
import React, { useEffect, useRef } from 'react'; function TextFocusTest () { const textRef = useRef(null); useEffect(() => { textRef.current.focus(); }); return( <input ref{textRef} type="text"> ); } export default TextFocusTest;