Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https://edu.duthanhduoc.com/learn/ReactJs-Super?lessonId=217 #85

Open
utterances-bot opened this issue Jan 2, 2025 · 3 comments
Open

Comments

@utterances-bot
Copy link

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

Copy link

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


Chọn ảnh

Copy link

"

Chọn ảnh
"

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants