What Is the useRefs Hook?

PHOTO EMBED

Thu Sep 01 2022 13:06:34 GMT+0000 (Coordinated Universal Time)

Saved by @EMR4HKLMN #javascript

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

const App = () => {
  const inputRef = useRef(null)
  
  useEffect(()=>{
    inputElRef.current.focus()
  }, [])
  
  return(
    <div>
      <input type="text" ref={inputRef} />
    </div>
  )
}

export default App;
content_copyCOPY

https://www.freecodecamp.org/news/react-interview-questions-and-answers/