// create refernce for element let refName= useState<HTMLDivElement>(null) //usage <div ref={refName} className=""></div> // access in useEffect refName.current