You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function isInputElement(target: EventTarget): target is HTMLInputElement {
return target instanceof HTMLInputElement
}
const resetFileRef = (e: React.MouseEvent<HTMLInputElement, MouseEvent>) => {
if (isInputElement(e.target)) {
e.target.value = ''
}
}
Em tìm đc cách này dùng type predicate, vs khai báo 1 hàm ra, còn type của event thì dùng cách của anh được gọi e xong hover nó ra, dùng thì vẫn báo lỗi đúng behavior như của anh Được
Khu vực học tập | Được Edu
Được chỉ cung cấp các khóa học lập trình online chất lượng, nói không với khóa lởm!
https://edu.duthanhduoc.com/learn/ReactJs-Super?lessonId=217
The text was updated successfully, but these errors were encountered: