useRef giúp chúng ta thao tác và xử lý DOM 1. Import các thứ cần thiết import { useEffect, useRef } from 'react' 2. Tạo ref const inputRef = useRef() 3. Gắn ref vào input <input type="text" ref={inputRef} /> 4. Tự động focus khi page loaded useEffect...

Markdown supported · ⌘↵ to post
No responses yet.