Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

react typescript input set focus dinamically

// ref for focus dinamically
const search = useRef<any>(null);
...
<input ref={search}/>
...
if(search.current?.focus)
	search.current?.focus();
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #react #typescript #input #set #focus #dinamically
ADD COMMENT
Topic
Name
9+3 =