react useref in useeffect

JavaScript
import React, { useEffect, useRef } from 'react';

const fooComponent = props => {
	const inputBtnRef = useRef(null);
  	useEffect(() => {
      //Add the ref action here
      inputBtnRef.current.focus();
    });
  
  	return (
      <div>
        <input
          type="text"
          ref={inputBtnRef} 
		/>
      </div>
    );
}
Source

Also in JavaScript: