Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

useref in react typescrpt

// create refernce for element
let refName= useState<HTMLDivElement>(null)
//usage
<div ref={refName} className=""></div>
// access in useEffect 
refName.current
 
PREVIOUS NEXT
Tagged: #useref #react #typescrpt
ADD COMMENT
Topic
Name
1+1 =